master: sysconfig did not exist until 2.7.

pull/595/head
David Wilson 5 years ago
parent 2f29f3e8e6
commit ed8acb5153

@ -46,12 +46,16 @@ import pkgutil
import re import re
import string import string
import sys import sys
import sysconfig
import threading import threading
import time import time
import types import types
import zlib import zlib
try:
import sysconfig
except ImportError:
sysconfig = None
if not hasattr(pkgutil, 'find_loader'): if not hasattr(pkgutil, 'find_loader'):
# find_loader() was new in >=2.5, but the modern pkgutil.py syntax has # find_loader() was new in >=2.5, but the modern pkgutil.py syntax has
# been kept intentionally 2.3 compatible so we can reuse it. # been kept intentionally 2.3 compatible so we can reuse it.
@ -101,7 +105,8 @@ def _stdlib_paths():
# When running 'unit2 tests/module_finder_test.py' in a Py2 venv on Ubuntu # When running 'unit2 tests/module_finder_test.py' in a Py2 venv on Ubuntu
# 18.10, above is insufficient to catch the real directory. # 18.10, above is insufficient to catch the real directory.
s.add(sysconfig.get_config_var('DESTLIB')) if sysconfig is not None:
s.add(sysconfig.get_config_var('DESTLIB'))
return s return s

Loading…
Cancel
Save