Skip to content

Commit

Permalink
found more place to replace sep
Browse files Browse the repository at this point in the history
  • Loading branch information
toyobayashi committed Jan 27, 2024
1 parent 82d5d76 commit 6a757fc
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions pylib/gyp/generator/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ def QuoteIfNecessary(string):

def replace_sep(string):
if sys.platform == 'win32':
string = string.replace('\\', '/')
string = string.replace('\\\\', '/').replace('\\', '/')
return string

def StringToMakefileVariable(string):
Expand Down Expand Up @@ -864,13 +864,7 @@ def Write(
self.output = self.ComputeMacBundleOutput(spec)
self.output_binary = self.ComputeMacBundleBinaryOutput(spec)
else:
if self.flavor == "win":
# prevent from generating copy targets on Windows
self.output = self.output_binary = self.ComputeOutput(spec).replace(
'\\', '/'
)
else:
self.output = self.output_binary = self.ComputeOutput(spec)
self.output = self.output_binary = replace_sep(self.ComputeOutput(spec))

self.is_standalone_static_library = bool(
spec.get("standalone_static_library", 0)
Expand Down Expand Up @@ -996,7 +990,7 @@ def WriteSubMake(self, output_filename, makefile_path, targets, build_dir):
# sub-project dir (see test/subdirectory/gyptest-subdir-all.py).
self.WriteLn(
"export builddir_name ?= %s"
% os.path.join(os.path.dirname(output_filename), build_dir)
% replace_sep(os.path.join(os.path.dirname(output_filename), build_dir))
)
self.WriteLn(".PHONY: all")
self.WriteLn("all:")
Expand Down Expand Up @@ -2380,10 +2374,10 @@ def WriteAutoRegenerationRule(params, root_makefile, makefile_name, build_files)
"\t$(call do_cmd,regen_makefile)\n\n"
% {
"makefile_name": makefile_name,
"deps": " ".join(SourceifyAndQuoteSpaces(bf) for bf in build_files),
"cmd": gyp.common.EncodePOSIXShellList(
"deps": replace_sep(" ".join(SourceifyAndQuoteSpaces(bf) for bf in build_files)),

Check failure on line 2377 in pylib/gyp/generator/make.py

View workflow job for this annotation

GitHub Actions / Python_tests (macos-latest, 3.8)

Ruff (E501)

pylib/gyp/generator/make.py:2377:89: E501 Line too long (93 > 88)

Check failure on line 2377 in pylib/gyp/generator/make.py

View workflow job for this annotation

GitHub Actions / Python_tests (macos-latest, 3.9)

Ruff (E501)

pylib/gyp/generator/make.py:2377:89: E501 Line too long (93 > 88)

Check failure on line 2377 in pylib/gyp/generator/make.py

View workflow job for this annotation

GitHub Actions / Python_tests (macos-latest, 3.10)

Ruff (E501)

pylib/gyp/generator/make.py:2377:89: E501 Line too long (93 > 88)

Check failure on line 2377 in pylib/gyp/generator/make.py

View workflow job for this annotation

GitHub Actions / Python_tests (macos-latest, 3.11)

Ruff (E501)

pylib/gyp/generator/make.py:2377:89: E501 Line too long (93 > 88)

Check failure on line 2377 in pylib/gyp/generator/make.py

View workflow job for this annotation

GitHub Actions / Python_tests (macos-latest, 3.12)

Ruff (E501)

pylib/gyp/generator/make.py:2377:89: E501 Line too long (93 > 88)

Check failure on line 2377 in pylib/gyp/generator/make.py

View workflow job for this annotation

GitHub Actions / Python_tests (ubuntu-latest, 3.8)

Ruff (E501)

pylib/gyp/generator/make.py:2377:89: E501 Line too long (93 > 88)

Check failure on line 2377 in pylib/gyp/generator/make.py

View workflow job for this annotation

GitHub Actions / Python_tests (ubuntu-latest, 3.9)

Ruff (E501)

pylib/gyp/generator/make.py:2377:89: E501 Line too long (93 > 88)

Check failure on line 2377 in pylib/gyp/generator/make.py

View workflow job for this annotation

GitHub Actions / Python_tests (ubuntu-latest, 3.10)

Ruff (E501)

pylib/gyp/generator/make.py:2377:89: E501 Line too long (93 > 88)

Check failure on line 2377 in pylib/gyp/generator/make.py

View workflow job for this annotation

GitHub Actions / Python_tests (ubuntu-latest, 3.11)

Ruff (E501)

pylib/gyp/generator/make.py:2377:89: E501 Line too long (93 > 88)

Check failure on line 2377 in pylib/gyp/generator/make.py

View workflow job for this annotation

GitHub Actions / Python_tests (ubuntu-latest, 3.12)

Ruff (E501)

pylib/gyp/generator/make.py:2377:89: E501 Line too long (93 > 88)
"cmd": replace_sep(gyp.common.EncodePOSIXShellList(
[gyp_binary, "-fmake"] + gyp.RegenerateFlags(options) + build_files_args
),
)),
}
)

Expand Down

0 comments on commit 6a757fc

Please sign in to comment.