Merge pull request #1173 from RumovZ/black-workaround

Fix black workaround for format calls
This commit is contained in:
Damien Elmes 2021-05-19 10:30:12 +10:00 committed by GitHub
commit f9c3a11b23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -20,7 +20,7 @@ if __name__ == "__main__":
args = ["--diff", "--check"] args = ["--diff", "--check"]
# work around issue with latest black # work around issue with latest black
if sys.platform == "win32": if sys.platform == "win32" and "HOME" in os.environ:
os.environ["USERPROFILE"] = os.environ["HOME"] os.environ["USERPROFILE"] = os.environ["HOME"]
retcode = subprocess.run( retcode = subprocess.run(

View file

@ -162,7 +162,7 @@ def write_file(path: str, hooks: List[Hook], prefix: str, suffix: str):
code += "\n" + suffix code += "\n" + suffix
# work around issue with latest black # work around issue with latest black
if sys.platform == "win32": if sys.platform == "win32" and "HOME" in os.environ:
os.environ["USERPROFILE"] = os.environ["HOME"] os.environ["USERPROFILE"] = os.environ["HOME"]
with open(path, "wb") as file: with open(path, "wb") as file:
file.write(code.encode("utf8")) file.write(code.encode("utf8"))

View file

@ -19,7 +19,7 @@ if __name__ == "__main__":
args = ["--diff", "--check"] args = ["--diff", "--check"]
# work around issue with latest black # work around issue with latest black
if sys.platform == "win32": if sys.platform == "win32" and "HOME" in os.environ:
os.environ["USERPROFILE"] = os.environ["HOME"] os.environ["USERPROFILE"] = os.environ["HOME"]
retcode = subprocess.run( retcode = subprocess.run(