mirror of
https://github.com/python/cpython.git
synced 2025-08-17 15:21:26 +00:00
gh-102781: fix cwd dependence in cases generator (#102782)
This commit is contained in:
parent
65fb7c4055
commit
174c4bfd0f
1 changed files with 3 additions and 1 deletions
|
@ -122,8 +122,9 @@ class Formatter:
|
||||||
self.prefix = " " * indent
|
self.prefix = " " * indent
|
||||||
self.emit_line_directives = emit_line_directives
|
self.emit_line_directives = emit_line_directives
|
||||||
self.lineno = 1
|
self.lineno = 1
|
||||||
|
filename = os.path.relpath(self.stream.name, ROOT)
|
||||||
# Make filename more user-friendly and less platform-specific
|
# Make filename more user-friendly and less platform-specific
|
||||||
filename = self.stream.name.replace("\\", "/")
|
filename = filename.replace("\\", "/")
|
||||||
if filename.startswith("./"):
|
if filename.startswith("./"):
|
||||||
filename = filename[2:]
|
filename = filename[2:]
|
||||||
if filename.endswith(".new"):
|
if filename.endswith(".new"):
|
||||||
|
@ -567,6 +568,7 @@ class Analyzer:
|
||||||
with open(filename) as file:
|
with open(filename) as file:
|
||||||
src = file.read()
|
src = file.read()
|
||||||
|
|
||||||
|
filename = os.path.relpath(filename, ROOT)
|
||||||
# Make filename more user-friendly and less platform-specific
|
# Make filename more user-friendly and less platform-specific
|
||||||
filename = filename.replace("\\", "/")
|
filename = filename.replace("\\", "/")
|
||||||
if filename.startswith("./"):
|
if filename.startswith("./"):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue