Skip to content

Commit 046d17e

Browse files
committed
Use unittest2 when testing Python 2.6
1 parent b770c6a commit 046d17e

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

setup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
# ------------------------------------------------------------------------------
3636

37+
import sys
38+
3739
try:
3840
from setuptools import setup
3941
except ImportError:
@@ -67,4 +69,6 @@
6769
'Programming Language :: Python :: 3.1',
6870
'Programming Language :: Python :: 3.2',
6971
'Programming Language :: Python :: 3.3',
70-
'Programming Language :: Python :: 3.4'])
72+
'Programming Language :: Python :: 3.4'],
73+
tests_require=['unittest2'] if sys.version_info < (2, 7) else []
74+
)

tests/test_config.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
from jsonrpclib.config import Config
1111

1212
# Standard library
13-
import unittest
13+
try:
14+
import unittest2 as unittest
15+
except ImportError:
16+
import unittest
1417

1518
# ------------------------------------------------------------------------------
1619

0 commit comments

Comments
 (0)