From d1610a97ff957b5c0ba924dcf7f8b30e0e66a173 Mon Sep 17 00:00:00 2001 From: Jakub Kocka Date: Tue, 28 Nov 2023 14:31:07 +0100 Subject: [PATCH] fix: fixed exit() to be used from right module --- espefuse/efuse/esp32c2/fields.py | 5 +++-- espefuse/efuse/esp32c3/fields.py | 5 +++-- espefuse/efuse/esp32c6/fields.py | 5 +++-- espefuse/efuse/esp32h2/fields.py | 5 +++-- espefuse/efuse/esp32h2beta1/fields.py | 5 +++-- espefuse/efuse/esp32p4/fields.py | 5 +++-- espefuse/efuse/esp32s2/fields.py | 5 +++-- espefuse/efuse/esp32s3/fields.py | 5 +++-- espefuse/efuse/esp32s3beta2/fields.py | 5 +++-- setup.py | 2 +- 10 files changed, 28 insertions(+), 19 deletions(-) diff --git a/espefuse/efuse/esp32c2/fields.py b/espefuse/efuse/esp32c2/fields.py index dda997e58..cba599e63 100644 --- a/espefuse/efuse/esp32c2/fields.py +++ b/espefuse/efuse/esp32c2/fields.py @@ -6,6 +6,7 @@ import binascii import struct +import sys import time from bitstring import BitArray @@ -198,7 +199,7 @@ def efuse_read(self): ) print("DIS_DOWNLOAD_MODE is enabled") print("Successful") - exit(0) # finish without errors + sys.exit(0) # finish without errors raise print("Established a connection with the chip") @@ -212,7 +213,7 @@ def efuse_read(self): ) print("ENABLE_SECURITY_DOWNLOAD is enabled") print("Successful") - exit(0) # finish without errors + sys.exit(0) # finish without errors raise def set_efuse_timing(self): diff --git a/espefuse/efuse/esp32c3/fields.py b/espefuse/efuse/esp32c3/fields.py index 7a09c65c5..05914e429 100644 --- a/espefuse/efuse/esp32c3/fields.py +++ b/espefuse/efuse/esp32c3/fields.py @@ -6,6 +6,7 @@ import binascii import struct +import sys import time from bitstring import BitArray @@ -206,7 +207,7 @@ def efuse_read(self): ) print("DIS_DOWNLOAD_MODE is enabled") print("Successful") - exit(0) # finish without errors + sys.exit(0) # finish without errors raise print("Established a connection with the chip") @@ -220,7 +221,7 @@ def efuse_read(self): ) print("ENABLE_SECURITY_DOWNLOAD is enabled") print("Successful") - exit(0) # finish without errors + sys.exit(0) # finish without errors raise def set_efuse_timing(self): diff --git a/espefuse/efuse/esp32c6/fields.py b/espefuse/efuse/esp32c6/fields.py index a62004f1a..5e0a449e5 100644 --- a/espefuse/efuse/esp32c6/fields.py +++ b/espefuse/efuse/esp32c6/fields.py @@ -6,6 +6,7 @@ import binascii import struct +import sys import time from bitstring import BitArray @@ -206,7 +207,7 @@ def efuse_read(self): ) print("DIS_DOWNLOAD_MODE is enabled") print("Successful") - exit(0) # finish without errors + sys.exit(0) # finish without errors raise print("Established a connection with the chip") @@ -220,7 +221,7 @@ def efuse_read(self): ) print("ENABLE_SECURITY_DOWNLOAD is enabled") print("Successful") - exit(0) # finish without errors + sys.exit(0) # finish without errors raise def set_efuse_timing(self): diff --git a/espefuse/efuse/esp32h2/fields.py b/espefuse/efuse/esp32h2/fields.py index add5db76f..46182607b 100644 --- a/espefuse/efuse/esp32h2/fields.py +++ b/espefuse/efuse/esp32h2/fields.py @@ -6,6 +6,7 @@ import binascii import struct +import sys import time from bitstring import BitArray @@ -206,7 +207,7 @@ def efuse_read(self): ) print("DIS_DOWNLOAD_MODE is enabled") print("Successful") - exit(0) # finish without errors + sys.exit(0) # finish without errors raise print("Established a connection with the chip") @@ -220,7 +221,7 @@ def efuse_read(self): ) print("ENABLE_SECURITY_DOWNLOAD is enabled") print("Successful") - exit(0) # finish without errors + sys.exit(0) # finish without errors raise def set_efuse_timing(self): diff --git a/espefuse/efuse/esp32h2beta1/fields.py b/espefuse/efuse/esp32h2beta1/fields.py index 3e8f28928..16bc78f04 100644 --- a/espefuse/efuse/esp32h2beta1/fields.py +++ b/espefuse/efuse/esp32h2beta1/fields.py @@ -6,6 +6,7 @@ import binascii import struct +import sys import time from bitstring import BitArray @@ -206,7 +207,7 @@ def efuse_read(self): ) print("DIS_DOWNLOAD_MODE is enabled") print("Successful") - exit(0) # finish without errors + sys.exit(0) # finish without errors raise print("Established a connection with the chip") @@ -220,7 +221,7 @@ def efuse_read(self): ) print("ENABLE_SECURITY_DOWNLOAD is enabled") print("Successful") - exit(0) # finish without errors + sys.exit(0) # finish without errors raise def set_efuse_timing(self): diff --git a/espefuse/efuse/esp32p4/fields.py b/espefuse/efuse/esp32p4/fields.py index 4b912ec5c..415a6b33d 100644 --- a/espefuse/efuse/esp32p4/fields.py +++ b/espefuse/efuse/esp32p4/fields.py @@ -6,6 +6,7 @@ import binascii import struct +import sys import time from bitstring import BitArray @@ -207,7 +208,7 @@ def efuse_read(self): ) print("DIS_DOWNLOAD_MODE is enabled") print("Successful") - exit(0) # finish without errors + sys.exit(0) # finish without errors raise print("Established a connection with the chip") @@ -221,7 +222,7 @@ def efuse_read(self): ) print("ENABLE_SECURITY_DOWNLOAD is enabled") print("Successful") - exit(0) # finish without errors + sys.exit(0) # finish without errors raise def set_efuse_timing(self): diff --git a/espefuse/efuse/esp32s2/fields.py b/espefuse/efuse/esp32s2/fields.py index a4113848b..15d927529 100644 --- a/espefuse/efuse/esp32s2/fields.py +++ b/espefuse/efuse/esp32s2/fields.py @@ -6,6 +6,7 @@ import binascii import struct +import sys import time from bitstring import BitArray @@ -206,7 +207,7 @@ def efuse_read(self): ) print("DIS_DOWNLOAD_MODE is enabled") print("Successful") - exit(0) # finish without errors + sys.exit(0) # finish without errors raise print("Established a connection with the chip") @@ -220,7 +221,7 @@ def efuse_read(self): ) print("ENABLE_SECURITY_DOWNLOAD is enabled") print("Successful") - exit(0) # finish without errors + sys.exit(0) # finish without errors raise def set_efuse_timing(self): diff --git a/espefuse/efuse/esp32s3/fields.py b/espefuse/efuse/esp32s3/fields.py index 604c4a45c..7cd8cd952 100644 --- a/espefuse/efuse/esp32s3/fields.py +++ b/espefuse/efuse/esp32s3/fields.py @@ -6,6 +6,7 @@ import binascii import struct +import sys import time from bitstring import BitArray @@ -206,7 +207,7 @@ def efuse_read(self): ) print("DIS_DOWNLOAD_MODE is enabled") print("Successful") - exit(0) # finish without errors + sys.exit(0) # finish without errors raise print("Established a connection with the chip") @@ -220,7 +221,7 @@ def efuse_read(self): ) print("ENABLE_SECURITY_DOWNLOAD is enabled") print("Successful") - exit(0) # finish without errors + sys.exit(0) # finish without errors raise def set_efuse_timing(self): diff --git a/espefuse/efuse/esp32s3beta2/fields.py b/espefuse/efuse/esp32s3beta2/fields.py index 26abb9f1f..0622350b1 100644 --- a/espefuse/efuse/esp32s3beta2/fields.py +++ b/espefuse/efuse/esp32s3beta2/fields.py @@ -6,6 +6,7 @@ import binascii import struct +import sys import time from bitstring import BitArray @@ -206,7 +207,7 @@ def efuse_read(self): ) print("DIS_DOWNLOAD_MODE is enabled") print("Successful") - exit(0) # finish without errors + sys.exit(0) # finish without errors raise print("Established a connection with the chip") @@ -220,7 +221,7 @@ def efuse_read(self): ) print("ENABLE_SECURITY_DOWNLOAD is enabled") print("Successful") - exit(0) # finish without errors + sys.exit(0) # finish without errors raise def set_efuse_timing(self): diff --git a/setup.py b/setup.py index 0f1b2826b..c80122659 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ "Please see the installation section in the esptool documentation" " for instructions on how to install it." ) - exit(1) + sys.exit(1) # Example code to pull version from esptool module with regex, taken from