fix up runAll.py for python 3.11; version --> 3.0.1
authorrobin
Fri, 24 Dec 2021 12:20:59 +0000
changeset 113 8ba60bb0ed37
parent 112 79b0997a73b8
child 114 bf2e9a81f2a9
fix up runAll.py for python 3.11; version --> 3.0.1
src/pyRXP.c
test/runAll.py
--- a/src/pyRXP.c	Thu Sep 30 08:30:38 2021 +0100
+++ b/src/pyRXP.c	Fri Dec 24 12:20:59 2021 +0000
@@ -22,7 +22,7 @@
 #include "stdio16.h"
 #include "version.h"
 #include "namespaces.h"
-#define VERSION "3.0.0"
+#define VERSION "3.0.1"
 #define MAX_DEPTH 256
 #if PY_VERSION_HEX < 0x02050000
 #	define Py_ssize_t int
--- a/test/runAll.py	Thu Sep 30 08:30:38 2021 +0100
+++ b/test/runAll.py	Fri Dec 24 12:20:59 2021 +0000
@@ -11,47 +11,50 @@
         return getattr(self.stream, attr)
 
 def main():
-    import sys, os, psutil, platform
+    import sys, os
+    dbg = int(os.environ.get('PYRXPDEBUG','0'))
     sys.__old_stderr__ = sys.stderr
     sys.__stderr__ = sys.stderr = sys.stdout = Unbuffered(sys.stdout)
     wd = os.path.dirname(os.path.abspath(sys.argv[0]))
     sys.path.insert(0,wd)
     os.chdir(wd)
-    platform_attrs = [
-        "architecture",
-        "java_ver",
-        "libc_ver",
-        "machine",
-        "mac_ver",
-        "node",
-        "platform",
-        "processor",
-        "python_branch",
-        "python_build",
-        "python_compiler",
-        "python_implementation",
-        "python_revision",
-        "python_version",
-        "python_version_tuple",
-        "release",
-        "system",
-        "system_alias",
-        "uname",
-        "version",
-        "win32_edition",
-        "win32_is_iot",
-        "win32_ver",
-        ]
-    print(f'+++++ {sys.platform}')
-    print(f'+++++ {sys.byteorder}')
-    for a in platform_attrs:
-        if hasattr(platform,a):
-            try:
-                print(f'+++++ platform.{a}()={getattr(platform,a)()}')
-            except:
-                print(f'!!!!! platform.{a}()=cannot be determined')
+    if dbg:
+        import psutil, platform
+        platform_attrs = [
+            "architecture",
+            "java_ver",
+            "libc_ver",
+            "machine",
+            "mac_ver",
+            "node",
+            "platform",
+            "processor",
+            "python_branch",
+            "python_build",
+            "python_compiler",
+            "python_implementation",
+            "python_revision",
+            "python_version",
+            "python_version_tuple",
+            "release",
+            "system",
+            "system_alias",
+            "uname",
+            "version",
+            "win32_edition",
+            "win32_is_iot",
+            "win32_ver",
+            ]
+        print(f'+++++ {sys.platform}')
+        print(f'+++++ {sys.byteorder}')
+        for a in platform_attrs:
+            if hasattr(platform,a):
+                try:
+                    print(f'+++++ platform.{a}()={getattr(platform,a)()}')
+                except:
+                    print(f'!!!!! platform.{a}()=cannot be determined')
 
-    #special case import to allow reportlab to modify the envirnment in development
+    #special case import to allow reportlab to modify the environment in development
     try:
       import reportlab
     except ImportError:
@@ -67,7 +70,8 @@
         test_xmltestsuite.main(verbose, singles)
     else:
         test_xmltestsuite.main(3,1)
-    print(f'+++++ open Files={psutil.Process().open_files()!r}')
+    if dbg:
+        print(f'+++++ open Files={psutil.Process().open_files()!r}')
 
 if __name__=='__main__':
     main()