mirror of
https://github.com/espressif/esptool.git
synced 2025-10-22 07:51:36 +08:00
fix: fixed exit() to be used from right module
This commit is contained in:

committed by
Radim Karniš

parent
e99c1149a1
commit
d1610a97ff
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
import binascii
|
import binascii
|
||||||
import struct
|
import struct
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from bitstring import BitArray
|
from bitstring import BitArray
|
||||||
@@ -198,7 +199,7 @@ class EspEfuses(base_fields.EspEfusesBase):
|
|||||||
)
|
)
|
||||||
print("DIS_DOWNLOAD_MODE is enabled")
|
print("DIS_DOWNLOAD_MODE is enabled")
|
||||||
print("Successful")
|
print("Successful")
|
||||||
exit(0) # finish without errors
|
sys.exit(0) # finish without errors
|
||||||
raise
|
raise
|
||||||
|
|
||||||
print("Established a connection with the chip")
|
print("Established a connection with the chip")
|
||||||
@@ -212,7 +213,7 @@ class EspEfuses(base_fields.EspEfusesBase):
|
|||||||
)
|
)
|
||||||
print("ENABLE_SECURITY_DOWNLOAD is enabled")
|
print("ENABLE_SECURITY_DOWNLOAD is enabled")
|
||||||
print("Successful")
|
print("Successful")
|
||||||
exit(0) # finish without errors
|
sys.exit(0) # finish without errors
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def set_efuse_timing(self):
|
def set_efuse_timing(self):
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
import binascii
|
import binascii
|
||||||
import struct
|
import struct
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from bitstring import BitArray
|
from bitstring import BitArray
|
||||||
@@ -206,7 +207,7 @@ class EspEfuses(base_fields.EspEfusesBase):
|
|||||||
)
|
)
|
||||||
print("DIS_DOWNLOAD_MODE is enabled")
|
print("DIS_DOWNLOAD_MODE is enabled")
|
||||||
print("Successful")
|
print("Successful")
|
||||||
exit(0) # finish without errors
|
sys.exit(0) # finish without errors
|
||||||
raise
|
raise
|
||||||
|
|
||||||
print("Established a connection with the chip")
|
print("Established a connection with the chip")
|
||||||
@@ -220,7 +221,7 @@ class EspEfuses(base_fields.EspEfusesBase):
|
|||||||
)
|
)
|
||||||
print("ENABLE_SECURITY_DOWNLOAD is enabled")
|
print("ENABLE_SECURITY_DOWNLOAD is enabled")
|
||||||
print("Successful")
|
print("Successful")
|
||||||
exit(0) # finish without errors
|
sys.exit(0) # finish without errors
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def set_efuse_timing(self):
|
def set_efuse_timing(self):
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
import binascii
|
import binascii
|
||||||
import struct
|
import struct
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from bitstring import BitArray
|
from bitstring import BitArray
|
||||||
@@ -206,7 +207,7 @@ class EspEfuses(base_fields.EspEfusesBase):
|
|||||||
)
|
)
|
||||||
print("DIS_DOWNLOAD_MODE is enabled")
|
print("DIS_DOWNLOAD_MODE is enabled")
|
||||||
print("Successful")
|
print("Successful")
|
||||||
exit(0) # finish without errors
|
sys.exit(0) # finish without errors
|
||||||
raise
|
raise
|
||||||
|
|
||||||
print("Established a connection with the chip")
|
print("Established a connection with the chip")
|
||||||
@@ -220,7 +221,7 @@ class EspEfuses(base_fields.EspEfusesBase):
|
|||||||
)
|
)
|
||||||
print("ENABLE_SECURITY_DOWNLOAD is enabled")
|
print("ENABLE_SECURITY_DOWNLOAD is enabled")
|
||||||
print("Successful")
|
print("Successful")
|
||||||
exit(0) # finish without errors
|
sys.exit(0) # finish without errors
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def set_efuse_timing(self):
|
def set_efuse_timing(self):
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
import binascii
|
import binascii
|
||||||
import struct
|
import struct
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from bitstring import BitArray
|
from bitstring import BitArray
|
||||||
@@ -206,7 +207,7 @@ class EspEfuses(base_fields.EspEfusesBase):
|
|||||||
)
|
)
|
||||||
print("DIS_DOWNLOAD_MODE is enabled")
|
print("DIS_DOWNLOAD_MODE is enabled")
|
||||||
print("Successful")
|
print("Successful")
|
||||||
exit(0) # finish without errors
|
sys.exit(0) # finish without errors
|
||||||
raise
|
raise
|
||||||
|
|
||||||
print("Established a connection with the chip")
|
print("Established a connection with the chip")
|
||||||
@@ -220,7 +221,7 @@ class EspEfuses(base_fields.EspEfusesBase):
|
|||||||
)
|
)
|
||||||
print("ENABLE_SECURITY_DOWNLOAD is enabled")
|
print("ENABLE_SECURITY_DOWNLOAD is enabled")
|
||||||
print("Successful")
|
print("Successful")
|
||||||
exit(0) # finish without errors
|
sys.exit(0) # finish without errors
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def set_efuse_timing(self):
|
def set_efuse_timing(self):
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
import binascii
|
import binascii
|
||||||
import struct
|
import struct
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from bitstring import BitArray
|
from bitstring import BitArray
|
||||||
@@ -206,7 +207,7 @@ class EspEfuses(base_fields.EspEfusesBase):
|
|||||||
)
|
)
|
||||||
print("DIS_DOWNLOAD_MODE is enabled")
|
print("DIS_DOWNLOAD_MODE is enabled")
|
||||||
print("Successful")
|
print("Successful")
|
||||||
exit(0) # finish without errors
|
sys.exit(0) # finish without errors
|
||||||
raise
|
raise
|
||||||
|
|
||||||
print("Established a connection with the chip")
|
print("Established a connection with the chip")
|
||||||
@@ -220,7 +221,7 @@ class EspEfuses(base_fields.EspEfusesBase):
|
|||||||
)
|
)
|
||||||
print("ENABLE_SECURITY_DOWNLOAD is enabled")
|
print("ENABLE_SECURITY_DOWNLOAD is enabled")
|
||||||
print("Successful")
|
print("Successful")
|
||||||
exit(0) # finish without errors
|
sys.exit(0) # finish without errors
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def set_efuse_timing(self):
|
def set_efuse_timing(self):
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
import binascii
|
import binascii
|
||||||
import struct
|
import struct
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from bitstring import BitArray
|
from bitstring import BitArray
|
||||||
@@ -207,7 +208,7 @@ class EspEfuses(base_fields.EspEfusesBase):
|
|||||||
)
|
)
|
||||||
print("DIS_DOWNLOAD_MODE is enabled")
|
print("DIS_DOWNLOAD_MODE is enabled")
|
||||||
print("Successful")
|
print("Successful")
|
||||||
exit(0) # finish without errors
|
sys.exit(0) # finish without errors
|
||||||
raise
|
raise
|
||||||
|
|
||||||
print("Established a connection with the chip")
|
print("Established a connection with the chip")
|
||||||
@@ -221,7 +222,7 @@ class EspEfuses(base_fields.EspEfusesBase):
|
|||||||
)
|
)
|
||||||
print("ENABLE_SECURITY_DOWNLOAD is enabled")
|
print("ENABLE_SECURITY_DOWNLOAD is enabled")
|
||||||
print("Successful")
|
print("Successful")
|
||||||
exit(0) # finish without errors
|
sys.exit(0) # finish without errors
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def set_efuse_timing(self):
|
def set_efuse_timing(self):
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
import binascii
|
import binascii
|
||||||
import struct
|
import struct
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from bitstring import BitArray
|
from bitstring import BitArray
|
||||||
@@ -206,7 +207,7 @@ class EspEfuses(base_fields.EspEfusesBase):
|
|||||||
)
|
)
|
||||||
print("DIS_DOWNLOAD_MODE is enabled")
|
print("DIS_DOWNLOAD_MODE is enabled")
|
||||||
print("Successful")
|
print("Successful")
|
||||||
exit(0) # finish without errors
|
sys.exit(0) # finish without errors
|
||||||
raise
|
raise
|
||||||
|
|
||||||
print("Established a connection with the chip")
|
print("Established a connection with the chip")
|
||||||
@@ -220,7 +221,7 @@ class EspEfuses(base_fields.EspEfusesBase):
|
|||||||
)
|
)
|
||||||
print("ENABLE_SECURITY_DOWNLOAD is enabled")
|
print("ENABLE_SECURITY_DOWNLOAD is enabled")
|
||||||
print("Successful")
|
print("Successful")
|
||||||
exit(0) # finish without errors
|
sys.exit(0) # finish without errors
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def set_efuse_timing(self):
|
def set_efuse_timing(self):
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
import binascii
|
import binascii
|
||||||
import struct
|
import struct
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from bitstring import BitArray
|
from bitstring import BitArray
|
||||||
@@ -206,7 +207,7 @@ class EspEfuses(base_fields.EspEfusesBase):
|
|||||||
)
|
)
|
||||||
print("DIS_DOWNLOAD_MODE is enabled")
|
print("DIS_DOWNLOAD_MODE is enabled")
|
||||||
print("Successful")
|
print("Successful")
|
||||||
exit(0) # finish without errors
|
sys.exit(0) # finish without errors
|
||||||
raise
|
raise
|
||||||
|
|
||||||
print("Established a connection with the chip")
|
print("Established a connection with the chip")
|
||||||
@@ -220,7 +221,7 @@ class EspEfuses(base_fields.EspEfusesBase):
|
|||||||
)
|
)
|
||||||
print("ENABLE_SECURITY_DOWNLOAD is enabled")
|
print("ENABLE_SECURITY_DOWNLOAD is enabled")
|
||||||
print("Successful")
|
print("Successful")
|
||||||
exit(0) # finish without errors
|
sys.exit(0) # finish without errors
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def set_efuse_timing(self):
|
def set_efuse_timing(self):
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
import binascii
|
import binascii
|
||||||
import struct
|
import struct
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from bitstring import BitArray
|
from bitstring import BitArray
|
||||||
@@ -206,7 +207,7 @@ class EspEfuses(base_fields.EspEfusesBase):
|
|||||||
)
|
)
|
||||||
print("DIS_DOWNLOAD_MODE is enabled")
|
print("DIS_DOWNLOAD_MODE is enabled")
|
||||||
print("Successful")
|
print("Successful")
|
||||||
exit(0) # finish without errors
|
sys.exit(0) # finish without errors
|
||||||
raise
|
raise
|
||||||
|
|
||||||
print("Established a connection with the chip")
|
print("Established a connection with the chip")
|
||||||
@@ -220,7 +221,7 @@ class EspEfuses(base_fields.EspEfusesBase):
|
|||||||
)
|
)
|
||||||
print("ENABLE_SECURITY_DOWNLOAD is enabled")
|
print("ENABLE_SECURITY_DOWNLOAD is enabled")
|
||||||
print("Successful")
|
print("Successful")
|
||||||
exit(0) # finish without errors
|
sys.exit(0) # finish without errors
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def set_efuse_timing(self):
|
def set_efuse_timing(self):
|
||||||
|
2
setup.py
2
setup.py
@@ -16,7 +16,7 @@ except ImportError:
|
|||||||
"Please see the installation section in the esptool documentation"
|
"Please see the installation section in the esptool documentation"
|
||||||
" for instructions on how to install it."
|
" for instructions on how to install it."
|
||||||
)
|
)
|
||||||
exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
# Example code to pull version from esptool module with regex, taken from
|
# Example code to pull version from esptool module with regex, taken from
|
||||||
|
Reference in New Issue
Block a user