Provides debuging option for TCP stream
The TCP BaseClient class has been modified to recognize an environment variable 'PYMODES_DEBUG'. When the variable is set to 'true', the stream will halt execution rather than restarting. This is for debugging purposes and does not alter the main functionality of the program.
This commit is contained in:
parent
6159691c3d
commit
312c77629b
@ -269,7 +269,16 @@ class BaseClient(Thread):
|
|||||||
|
|
||||||
time.sleep(0.001)
|
time.sleep(0.001)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("Unexpected Error:", e)
|
|
||||||
|
# Provides the user an option to supply the environment
|
||||||
|
# variable PYMODES_DEBUG to halt the execution
|
||||||
|
# for debugging purposes
|
||||||
|
debug_intent = os.environ.get('PYMODES_DEBUG', None)
|
||||||
|
if debug_intent.lower() == 'true':
|
||||||
|
sys.exc_info()
|
||||||
|
sys.exit()
|
||||||
|
else:
|
||||||
|
print("Unexpected Error:", e)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
sock = self.connect()
|
sock = self.connect()
|
||||||
|
Loading…
Reference in New Issue
Block a user