[libxml2/python3-windows: 30/32] tstmem.py: Try importing from libxmlmods.libxml2mod if needed




commit 1e87f1651f4379e43ed5ac01ed31bffcd30f914f
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Thu Jul 22 14:46:48 2021 +0800

    tstmem.py: Try importing from libxmlmods.libxml2mod if needed
    
    Distutils builds place libxml2mod.pyd under the libxmlmods subdir, so try this
    directory if 'import libxml2mod' failed.

 python/tests/tstmem.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/python/tests/tstmem.py b/python/tests/tstmem.py
index 6b34cf38..4e339912 100755
--- a/python/tests/tstmem.py
+++ b/python/tests/tstmem.py
@@ -1,6 +1,11 @@
 #!/usr/bin/python -u
 import libxml2
-import libxml2mod
+
+try:
+    import libxml2mod
+except ModuleNotFoundError:
+    from libxmlmods import libxml2mod
+
 import sys
 
 def error(msg, data):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]