Skip to content

Commit

Permalink
fix py3-indb-app test failure (not that this code path is in actual u…
Browse files Browse the repository at this point in the history
…se in DB, maybe remove text is None case)
  • Loading branch information
justvanrossum committed Dec 21, 2017
1 parent aefa6e7 commit f261437
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drawBot/scriptTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ def userCancelledMonitor():
sys.path.insert(0, curDir)
# here we go
if text is None:
with open(path, 'r') as f:
text = f.read()
with open(path, 'rb') as f:
text = f.read().decode("utf-8")
source = text.replace('\r\n', '\n').replace('\r', '\n')
if PY2 and hasEncodingDeclaration(source) and isinstance(source, unicode):
# Python 2 compile() complains when an encoding declaration is found in a unicode string.
Expand Down

0 comments on commit f261437

Please sign in to comment.