summaryrefslogtreecommitdiff
path: root/Lib/linecache.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/linecache.py')
-rw-r--r--Lib/linecache.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/Lib/linecache.py b/Lib/linecache.py
index 974b1d965a..c3f2c3fdca 100644
--- a/Lib/linecache.py
+++ b/Lib/linecache.py
@@ -123,9 +123,7 @@ def updatecache(filename, module_globals=None):
else:
return []
try:
- with open(fullname, 'rb') as fp:
- coding, line = tokenize.detect_encoding(fp.readline)
- with open(fullname, 'r', encoding=coding) as fp:
+ with tokenize.open(fullname) as fp:
lines = fp.readlines()
except IOError:
return []