Skip to content

Commit

Permalink
v1.61
Browse files Browse the repository at this point in the history
-Fixed issue in wrapper causing error when compilied into .exe
  • Loading branch information
RLAlpha49 committed Nov 3, 2023
1 parent 7c191d5 commit c432260
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@ def wrapper(*args, **kwargs):

output = f"{func.__name__:30} Function took: {(after - before):.15f} seconds. Called from {caller_file:14} line {caller_line}"

# Check if the current line has anything on it
current_line = sys.stdout.write("\r" + " " * 80) # Clear the current line
sys.stdout.flush()
print("\r" + output) # Print the output on the cleared line
try:
if sys.stdout:
# Check if sys.stdout is available before calling flush
current_line = sys.stdout.write("\r" + " " * 80) # Clear the current line
sys.stdout.flush()
print("\r" + output) # Print the output on the cleared line
except Exception as e:
# Handle any exceptions related to sys.stdout
print("An error occurred while printing timing information:", str(e))

return result

Expand Down

0 comments on commit c432260

Please sign in to comment.