Skip to content

Commit 241a367

Browse files
committed
Merge pull request #38 from ionelmc/patch-1
Allow import to fail, a `.pth` file is not a good place to raise exceptions
2 parents f609c06 + ee119a0 commit 241a367

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cov-core/setup.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@
1010
# The line in the path file must begin with "import"
1111
# so that site.py will exec it.
1212
PTH_FILE = '''\
13-
import os; 'COV_CORE_SOURCE' in os.environ and __import__('cov_core_init').init()
13+
import os; exec(%r)
14+
''' % '''
15+
if 'COV_CORE_SOURCE' in os.environ:
16+
try:
17+
import cov_core_init
18+
cov_core_init.init()
19+
except ImportError:
20+
pass
1421
'''
1522

1623
PTH_FILE_FAILURE = '''

0 commit comments

Comments
 (0)