Skip to content

Commit 3f88ef5

Browse files
committed
Fallback to pure Python version if C extension can't be installed
1 parent 7a25369 commit 3f88ef5

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

setup.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
elif sys.version_info[0] == 3:
1616
base_dir = 'python3'
1717

18-
setup(
18+
setup_dict = dict(
1919
name='cobs',
2020
version=_version.__version__,
2121
description='Consistent Overhead Byte Stuffing (COBS)',
@@ -55,3 +55,11 @@
5555
'Topic :: Communications',
5656
],
5757
)
58+
59+
try:
60+
setup(**setup_dict)
61+
except KeyboardInterrupt:
62+
raise
63+
except:
64+
del setup_dict['ext_modules']
65+
setup(**setup_dict)

0 commit comments

Comments
 (0)