diff options
Diffstat (limited to 'Lib/cProfile.py')
-rwxr-xr-x | Lib/cProfile.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/cProfile.py b/Lib/cProfile.py index f7000a8..135a12c 100755 --- a/Lib/cProfile.py +++ b/Lib/cProfile.py @@ -8,6 +8,7 @@ __all__ = ["run", "runctx", "Profile"] import _lsprof import importlib.machinery +import io import profile as _pyprofile # ____________________________________________________________ @@ -168,7 +169,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) |