1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-21 14:53:44 +03:00

python/setup.py.in: Improve Windows import patching

Move up the altImport function so that we ensure that it can be referred
to and streamline it a bit, since we no longer attempt to build the
libxslt Python bits here, at least on Windows.
This commit is contained in:
Chun-wei Fan
2022-11-18 17:36:14 +08:00
committed by Chun-wei Fan
parent e208eaa27a
commit d7e698fca8

View File

@@ -45,6 +45,11 @@ icu_dlls = ['icuuc%s.dll' % icu_series_s, 'icudt%s.dll' % icu_series_s]
# dlls must be found somewhere in the PATH at runtime.
WITHDLLS = 1 and sys.platform.startswith('win')
if WITHDLLS:
def altImport(s):
s = s.replace("import libxml2mod","from libxmlmods import libxml2mod")
return s
def missing(file):
if os.access(file, os.R_OK) == 0:
return 1
@@ -182,11 +187,6 @@ if WITHDLLS:
os.mkdir("libxmlmods")
open("libxmlmods/__init__.py","w").close()
def altImport(s):
s = s.replace("import libxml2mod","from libxmlmods import libxml2mod")
s = s.replace("import libxsltmod","from libxmlmods import libxsltmod")
return s
packaged_dlls = [os.path.join(ROOT,'bin',dll) for dll in dlls]
descr = "libxml2 package"