summaryrefslogtreecommitdiffstats
path: root/Lib/profile.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/profile.py')
-rwxr-xr-xLib/profile.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/profile.py b/Lib/profile.py
index 453e562..4b82523 100755
--- a/Lib/profile.py
+++ b/Lib/profile.py
@@ -25,6 +25,7 @@
import importlib.machinery
+import io
import sys
import time
import marshal
@@ -588,7 +589,7 @@ def main():
else:
progname = args[0]
sys.path.insert(0, os.path.dirname(progname))
- with open(progname, 'rb') as fp:
+ with io.open_code(progname) as fp:
code = compile(fp.read(), progname, 'exec')
spec = importlib.machinery.ModuleSpec(name='__main__', loader=None,
origin=progname)