Skip to content

Commit

Permalink
Merge pull request #1390 from ales-erjavec/win-stderr-stream-fix
Browse files Browse the repository at this point in the history
[FIX] Fix a logging error on windows
  • Loading branch information
kernc authored Jun 30, 2016
2 parents 7639987 + 9967738 commit 688a162
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Orange/canvas/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ def fix_win_pythonw_std_stream():
"""
if sys.platform == "win32" and \
os.path.basename(sys.executable) == "pythonw.exe":
if sys.stdout is not None and sys.stdout.fileno() < 0:
sys.stdout = open(os.devnull, "wb")
if sys.stdout is not None and sys.stderr.fileno() < 0:
sys.stderr = open(os.devnull, "wb")
if sys.stdout is None:
sys.stdout = open(os.devnull, "w")
if sys.stderr is None:
sys.stderr = open(os.devnull, "w")


def make_sql_logger(level=logging.INFO):
Expand Down

0 comments on commit 688a162

Please sign in to comment.