mirror of
https://github.com/Karmaz95/Snake_Apple.git
synced 2026-05-15 16:47:58 +02:00
Add error handling for subprocess output in dtrace scripts
This commit is contained in:
Regular → Executable
+2
-1
@@ -64,7 +64,8 @@ def main():
|
||||
stdout=subprocess.PIPE,
|
||||
text=True,
|
||||
bufsize=1,
|
||||
preexec_fn=os.setsid
|
||||
preexec_fn=os.setsid,
|
||||
errors="replace" # <-- Add this argument to handle decode errors
|
||||
)
|
||||
|
||||
# Use a thread-safe event to ensure the signal handler logic runs only once.
|
||||
|
||||
Regular → Executable
+2
-1
@@ -68,7 +68,8 @@ def main():
|
||||
stdout=subprocess.PIPE,
|
||||
text=True,
|
||||
bufsize=1,
|
||||
preexec_fn=os.setsid
|
||||
preexec_fn=os.setsid,
|
||||
errors="replace" # Handle decode errors gracefully
|
||||
)
|
||||
|
||||
# Use a thread-safe event to ensure the signal handler logic runs only once.
|
||||
|
||||
Reference in New Issue
Block a user