Skip to content

Commit 4012e24

Browse files
author
Tadej Borovšak
committed
Reorder imp and importlib imports
Python 3.4 deprecated the imp module in favor of importlib. Because we use imp module by default, using selinux package with Python 3.4+ emits a deprecation warning: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses. This commit makes the importlib default module and imp a fallback one.
1 parent 984eae6 commit 4012e24

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

selinux/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
import sys
1717

1818
try:
19-
from imp import reload # type: ignore # noqa
20-
except ImportError: # py34+
2119
from importlib import reload # type: ignore # noqa
20+
except ImportError: # py < 34
21+
from imp import reload # type: ignore # noqa
2222

2323

2424
class add_path(object):

0 commit comments

Comments
 (0)