mirror of
https://github.com/python/cpython.git
synced 2025-11-25 12:44:13 +00:00
Fix SF # 464405, freeze doesn't like DOS files on Linux
Use universal newline support when opening a file for freezing.
This commit is contained in:
parent
3d03968c75
commit
74416af9dc
1 changed files with 2 additions and 2 deletions
|
|
@ -116,14 +116,14 @@ class ModuleFinder:
|
|||
|
||||
def run_script(self, pathname):
|
||||
self.msg(2, "run_script", pathname)
|
||||
fp = open(pathname)
|
||||
fp = open(pathname, "U")
|
||||
stuff = ("", "r", imp.PY_SOURCE)
|
||||
self.load_module('__main__', fp, pathname, stuff)
|
||||
|
||||
def load_file(self, pathname):
|
||||
dir, name = os.path.split(pathname)
|
||||
name, ext = os.path.splitext(name)
|
||||
fp = open(pathname)
|
||||
fp = open(pathname, "U")
|
||||
stuff = (ext, "r", imp.PY_SOURCE)
|
||||
self.load_module(name, fp, pathname, stuff)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue