Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gboeing committed Oct 10, 2023
1 parent 25d07ea commit be32a50
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions osmnx/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,14 +297,14 @@ def log(message, level=None, name=None, filename=None):

# if logging to console (terminal window) is turned on
if settings.log_console:
# prepend timestamp then convert to ascii for windows command prompts
# prepend timestamp then convert to ASCII for Windows command prompts
message = f"{ts()} {message}"
message = ud.normalize("NFKD", message).encode("ascii", errors="replace").decode()

try:
# print explicitly to terminal in case jupyter notebook is the stdout
# print explicitly to terminal in case Jupyter has captured stdout
if getattr(sys.stdout, "_original_stdstream_copy", None) is not None:
# redirect jupyter-captured pipe back to original
# redirect the Jupyter-captured pipe back to original
os.dup2(sys.stdout._original_stdstream_copy, sys.__stdout__.fileno())
sys.stdout._original_stdstream_copy = None

Check warning on line 309 in osmnx/utils.py

View check run for this annotation

Codecov / codecov/patch

osmnx/utils.py#L308-L309

Added lines #L308 - L309 were not covered by tests
with redirect_stdout(sys.__stdout__):
Expand Down

0 comments on commit be32a50

Please sign in to comment.