Skip to content

Commit 1756c81

Browse files
committed
Swap those runtime errors for OSerrors - most will be.
Also removed some extraneous brackets on OSerrors.
1 parent fa311a1 commit 1756c81

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

examples/esp32spi_simpletest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
while not esp.is_connected:
6060
try:
6161
esp.connect_AP(secrets["ssid"], secrets["password"])
62-
except RuntimeError as e:
62+
except OSError as e:
6363
print("could not connect to AP, retrying: ", e)
6464
continue
6565
print("Connected to", str(esp.ssid, "utf-8"), "\tRSSI:", esp.rssi)

examples/esp32spi_simpletest_rp2040.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
while not esp.is_connected:
4343
try:
4444
esp.connect_AP(secrets["ssid"], secrets["password"])
45-
except RuntimeError as e:
45+
except OSError as e:
4646
print("could not connect to AP, retrying: ", e)
4747
continue
4848
print("Connected to", str(esp.ssid, "utf-8"), "\tRSSI:", esp.rssi)

examples/gpio/esp32spi_gpio.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def esp_init_pin_modes(din, dout):
9494
esp_init_pin_modes(ESP_D_R_PIN, ESP_D_W_PIN)
9595
esp_d_r_val = esp.set_digital_read(ESP_D_R_PIN)
9696
print("--> ESP read:", esp_d_r_val)
97-
except (RuntimeError, AssertionError) as e:
97+
except (OSError, AssertionError) as e:
9898
print("ESP32 Error", e)
9999
esp_reset_all()
100100

@@ -104,7 +104,7 @@ def esp_init_pin_modes(din, dout):
104104
esp_init_pin_modes(ESP_D_R_PIN, ESP_D_W_PIN)
105105
esp.set_digital_write(ESP_D_W_PIN, esp_d_w_val)
106106
print("ESP wrote:", esp_d_w_val, "--> Red LED")
107-
except (RuntimeError) as e:
107+
except OSError as e:
108108
print("ESP32 Error", e)
109109
esp_reset_all()
110110

@@ -121,7 +121,7 @@ def esp_init_pin_modes(din, dout):
121121
"v)",
122122
sep="",
123123
)
124-
except (RuntimeError, AssertionError) as e:
124+
except (OSError, AssertionError) as e:
125125
print("ESP32 Error", e)
126126
esp_reset_all()
127127

@@ -166,7 +166,7 @@ def esp_init_pin_modes(din, dout):
166166
sep="",
167167
)
168168

169-
except (RuntimeError) as e:
169+
except OSError as e:
170170
print("ESP32 Error", e)
171171
esp_reset_all()
172172

0 commit comments

Comments
 (0)