Add backports_abc and singledispatch_helpers to thin as well

This commit is contained in:
Colton Myers 2015-11-12 10:28:35 -07:00
parent da1a2773dd
commit 1e1a74fd61

View file

@ -31,6 +31,18 @@ try:
except ImportError:
HAS_SINGLEDISPATCH = False
try:
import singledispatch_helpers
HAS_SINGLEDISPATCH_HELPERS = True
except ImportError:
HAS_SINGLEDISPATCH_HELPERS = False
try:
import backports_abc
HAS_BACKPORTS_ABC = True
except ImportError:
HAS_BACKPORTS_ABC = False
try:
import markupsafe
HAS_MARKUPSAFE = True
@ -127,7 +139,13 @@ def gen_thin(cachedir, extra_mods='', overwrite=False, so_mods=''):
tops.append(os.path.dirname(certifi.__file__))
if HAS_SINGLEDISPATCH:
tops.append(os.path.dirname(singledispatch.__file__))
tops.append(singledispatch.__file__.replace('.pyc', '.py'))
if HAS_SINGLEDISPATCH_HELPERS:
tops.append(singledispatch_helpers.__file__.replace('.pyc', '.py'))
if HAS_BACKPORTS_ABC:
tops.append(backports_abc.__file__.replace('.pyc', '.py'))
if HAS_SSL_MATCH_HOSTNAME:
tops.append(os.path.dirname(os.path.dirname(ssl_match_hostname.__file__)))