Skip to content

Commit 03e5624

Browse files
committed
Add some print statements when loading up libraries fails
(this happens when libraries are loaded without hardware)
1 parent a42684b commit 03e5624

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Software/Python/easygopigo3.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@
1212
import gopigo3
1313
except ImportError:
1414
hardware_connected = False
15-
except:
15+
print("Cannot import gopigo3 library")
16+
except Exception as e:
1617
hardware_connected = False
18+
print("Unknown issue while importing gopigo3")
19+
print(e)
1720

1821

1922
# from datetime import datetime

Software/Python/gopigo3.py

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import fcntl # for lockf mutex support
1919
except:
2020
hardware_connected = False
21+
print ("Can't import spidev or fcntl")
2122

2223
import math # import math for math.pi constant
2324
import time

0 commit comments

Comments
 (0)