|
@@ -48,7 +48,10 @@ def getTarget():
|
48
|
48
|
targetPlatform = "pi"
|
49
|
49
|
except Exception as e:
|
50
|
50
|
print()
|
51
|
|
- sys.print_exception(e)
|
|
51
|
+ if hasattr(sys, "print_exception"):
|
|
52
|
+ sys.print_exception(e)
|
|
53
|
+ else:
|
|
54
|
+ print(e)
|
52
|
55
|
print()
|
53
|
56
|
|
54
|
57
|
try:
|
|
@@ -66,7 +69,10 @@ def getTarget():
|
66
|
69
|
targetPlatform = "pico"
|
67
|
70
|
except Exception as e:
|
68
|
71
|
print()
|
69
|
|
- sys.print_exception(e)
|
|
72
|
+ if hasattr(sys, "print_exception"):
|
|
73
|
+ sys.print_exception(e)
|
|
74
|
+ else:
|
|
75
|
+ print(e)
|
70
|
76
|
print()
|
71
|
77
|
|
72
|
78
|
# If this fails fall back to the SDL/pygame GUI
|
|
@@ -92,8 +98,12 @@ def connectToWiFi():
|
92
|
98
|
from pico import PicoMatrix
|
93
|
99
|
except Exception as e:
|
94
|
100
|
print()
|
95
|
|
- sys.print_exception(e)
|
|
101
|
+ if hasattr(sys, "print_exception"):
|
|
102
|
+ sys.print_exception(e)
|
|
103
|
+ else:
|
|
104
|
+ print(e)
|
96
|
105
|
print()
|
|
106
|
+
|
97
|
107
|
wifiConnected = True
|
98
|
108
|
return True
|
99
|
109
|
|
|
@@ -167,7 +177,10 @@ def getRequests():
|
167
|
177
|
return requests.get
|
168
|
178
|
except Exception as e:
|
169
|
179
|
print()
|
170
|
|
- sys.print_exception(e)
|
|
180
|
+ if hasattr(sys, "print_exception"):
|
|
181
|
+ sys.print_exception(e)
|
|
182
|
+ else:
|
|
183
|
+ print(e)
|
171
|
184
|
print()
|
172
|
185
|
|
173
|
186
|
# if it fails try the Pi Pico MicroPython implementation
|
|
@@ -189,7 +202,10 @@ def getTextDrawer():
|
189
|
202
|
return DrawText
|
190
|
203
|
except Exception as e:
|
191
|
204
|
print()
|
192
|
|
- sys.print_exception(e)
|
|
205
|
+ if hasattr(sys, "print_exception"):
|
|
206
|
+ sys.print_exception(e)
|
|
207
|
+ else:
|
|
208
|
+ print(e)
|
193
|
209
|
print()
|
194
|
210
|
|
195
|
211
|
# fall back to the Pico Interstate75 implementation
|