[pypy-svn] r17950 - pypy/dist/pypy/translator/goal

tismer at codespeak.net tismer at codespeak.net
Wed Sep 28 22:34:25 CEST 2005


Author: tismer
Date: Wed Sep 28 22:34:24 2005
New Revision: 17950

Modified:
   pypy/dist/pypy/translator/goal/bench-windows.py
Log:
smal improvement in size calculation of the CPython executable

Modified: pypy/dist/pypy/translator/goal/bench-windows.py
==============================================================================
--- pypy/dist/pypy/translator/goal/bench-windows.py	(original)
+++ pypy/dist/pypy/translator/goal/bench-windows.py	Wed Sep 28 22:34:24 2005
@@ -88,16 +88,16 @@
     return bench_exe
 
 def run_version_size(executable=reference('python'), *args):
-    ver, size = run_cmd('''%s -c "import sys,os;print sys.version.split()[0],\\
-                           os.path.getsize(sys.executable)"'''
-                        % executable).split()
+    ver, size, dll = run_cmd('%s -c "import sys, os; print sys.version.split()[0], '
+                             'os.path.getsize(sys.executable), sys.dllhandle"'
+                             % executable).split()
     size = int(size)
     try:
-        sys.dllhandle
-    except AttributeError:
+        import win32api
+    except ImportError:
         pass
     else:
-        size += os.path.getsize(win32api.GetModuleFileName(sys.dllhandle))
+        size += os.path.getsize(win32api.GetModuleFileName(int(dll)))
     return ver, size
 
 def run_pystone(executable=reference('python'), n=0):



More information about the Pypy-commit mailing list