From 0d7c0d4ecbe09aef95eda0f2bbab354b45016537 Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Fri, 18 Apr 2014 15:44:31 +0200 Subject: Avoid endless import loop in lmi.test.unittest. lmi.test.unittest is now defined directly in lmi/test/__init__.py --- src/python/lmi/test/__init__.py | 8 ++++++++ src/python/lmi/test/unittest.py | 28 ---------------------------- 2 files changed, 8 insertions(+), 28 deletions(-) delete mode 100644 src/python/lmi/test/unittest.py (limited to 'src/python') diff --git a/src/python/lmi/test/__init__.py b/src/python/lmi/test/__init__.py index 9d2a63e..7111ea5 100644 --- a/src/python/lmi/test/__init__.py +++ b/src/python/lmi/test/__init__.py @@ -18,3 +18,11 @@ # # Authors: Michal Minar # + +# hack to use lmi.test.unittest as common module for unittest or unittest2, +# based on python version +import sys +if sys.version_info[0] > 2 or sys.version_info[1] > 6: + import unittest +else: + import unittest2 as unittest diff --git a/src/python/lmi/test/unittest.py b/src/python/lmi/test/unittest.py deleted file mode 100644 index 66492b8..0000000 --- a/src/python/lmi/test/unittest.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (C) 2014 Red Hat, Inc. All rights reserved. -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -# -# Authors: Jan Safranke -# -""" -This is a dummy module, which serves either as 'unittest' on Python >= 2.7 -or 'unittest2' on Python <= 2.6 -""" - -import sys -if sys.version_info[0] > 2 or sys.version_info[1] > 6: - from unittest import * -else: - from unittest2 import * -- cgit