diff options
author | Julien Jehannet <julien.jehannet@logilab.fr> | 2010-11-17 19:22:52 +0100 |
---|---|---|
committer | Julien Jehannet <julien.jehannet@logilab.fr> | 2010-11-17 19:22:52 +0100 |
commit | b533d48c3d606549772aeb9bc7697e13974ef023 (patch) | |
tree | f1a96134dd7f9409f3f0d0adbbc811ed52a76e46 /testlib.py | |
parent | cb7f88527dc1ed478b45e52307e0b83718cfcb5d (diff) | |
download | logilab-common-b533d48c3d606549772aeb9bc7697e13974ef023.tar.gz |
pytest: make test suite compatible with 2.7
Diffstat (limited to 'testlib.py')
-rw-r--r-- | testlib.py | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -57,7 +57,8 @@ from ConfigParser import ConfigParser from logilab.common.deprecation import deprecated from itertools import dropwhile -if sys.version_info < (3, 2): +import unittest as unittest_legacy +if not getattr(unittest_legacy, "__package__", None): try: import unittest2 as unittest from unittest2 import SkipTest @@ -969,7 +970,7 @@ succeeded test into", osp.join(os.getcwd(), FILE_RESTART) from xml.parsers.expat import ExpatError try: parse(data) - except ExpatError, ex: + except (ExpatError, ParseError), ex: if msg is None: if hasattr(data, 'readlines'): #file like object data.seek(0) |