Skip to content

Commit

Permalink
Workaround for #334.
Browse files Browse the repository at this point in the history
  • Loading branch information
itamarst committed Mar 27, 2022
1 parent 6e5114f commit 73bd917
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .changelog/334.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added explanation of why error messages are printed on macOS when opening browser. ([#334](https://github.com/pythonspeed/filprofiler/issues/334))
6 changes: 6 additions & 0 deletions filprofiler/_tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ def shutdown():
print("=fil-profile= Wrote HTML report to " + index_path, file=sys.stderr)
if open_browser:
try:
print(
"=fil-profile= Trying to open the report in a browser.",
"In some cases this may print error messages, especially on macOS.",
"You can ignore those, it's just garbage output from the browser.",
file=sys.stderr,
)
webbrowser.open("file://" + os.path.abspath(index_path))
except webbrowser.Error as e:
print(
Expand Down

0 comments on commit 73bd917

Please sign in to comment.