mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-24 00:04:09 +03:00
Use f-string
This commit is contained in:
parent
ed0867abec
commit
a3356879fd
|
@ -409,15 +409,14 @@ class TestEmbeddable:
|
||||||
from setuptools.command import build_ext
|
from setuptools.command import build_ext
|
||||||
|
|
||||||
with open("embed_pil.c", "w", encoding="utf-8") as fh:
|
with open("embed_pil.c", "w", encoding="utf-8") as fh:
|
||||||
|
home = sys.prefix.replace("\\", "\\\\")
|
||||||
fh.write(
|
fh.write(
|
||||||
"""
|
f"""
|
||||||
#include "Python.h"
|
#include "Python.h"
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{{
|
||||||
char *home = \""""
|
char *home = "{home}";
|
||||||
+ sys.prefix.replace("\\", "\\\\")
|
|
||||||
+ """\";
|
|
||||||
wchar_t *whome = Py_DecodeLocale(home, NULL);
|
wchar_t *whome = Py_DecodeLocale(home, NULL);
|
||||||
Py_SetPythonHome(whome);
|
Py_SetPythonHome(whome);
|
||||||
|
|
||||||
|
@ -432,7 +431,7 @@ int main(int argc, char* argv[])
|
||||||
PyMem_RawFree(whome);
|
PyMem_RawFree(whome);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}}
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user