Commit 94ca1c62 authored by Guido van Rossum's avatar Guido van Rossum

linecache.py was still struggling with unicode vs. non-unicode.

parent 390bd7c6
...@@ -139,8 +139,9 @@ def updatecache(filename, module_globals=None): ...@@ -139,8 +139,9 @@ def updatecache(filename, module_globals=None):
coding = m.group(1) coding = m.group(1)
break break
try: try:
lines = [unicode(line, coding) for line in lines] lines = [line if isinstance(line, str) else str(line, coding)
except UnicodeError: for line in lines]
except:
pass # Hope for the best pass # Hope for the best
size, mtime = stat.st_size, stat.st_mtime size, mtime = stat.st_size, stat.st_mtime
cache[filename] = size, mtime, lines, fullname cache[filename] = size, mtime, lines, fullname
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment