Skip to content

Commit 849a234

Browse files
author
Bob McMichael
committed
adds __name__ == '__main__' diagnostics
1 parent 6ca76cf commit 849a234

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

optbayesexpt/constants.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,15 @@
77
GOT_NUMBA = False
88
if sys.version_info[0] == 3:
99
if sys.version_info[1] <= 3:
10-
if importlib.import_loader('numba') is not None:
11-
GOT_NUMBA = True
10+
numba_module = importlib.import_loader('numba')
1211
if sys.version_info[1] >= 4:
13-
if importlib.util.find_spec('numba') is not None:
14-
GOT_NUMBA = True
12+
numba_module = importlib.util.find_spec('numba')
13+
14+
if numba_module is not None:
15+
GOT_NUMBA = True
16+
17+
if __name__ == '__main__':
18+
print(f'version = {version}')
19+
print(f'GOT_NUMBA = {GOT_NUMBA}')
20+
if GOT_NUMBA:
21+
print(numba_module)

0 commit comments

Comments
 (0)