Skip to content

Commit b072a46

Browse files
committed
Restore Python 2 compatibility.
1 parent 1028cb9 commit b072a46

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ testing =
4141
importlib_resources>=1.3; python_version < "3.9"
4242
packaging
4343
pep517
44+
unittest2; python_version < "3"
4445
docs =
4546
sphinx
4647
rst.linker

tests/test_api.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import re
22
import textwrap
3-
import unittest
3+
4+
try:
5+
import unittest2 as unittest
6+
except ImportError:
7+
import unittest
48

59
from . import fixtures
610
from importlib_metadata import (

0 commit comments

Comments
 (0)