- Add x64 support for Microsoft Visual Studio 8.
+ From Baptiste Lepilleur:
+
+ - Support the --debug=memory option on Windows when the Python version
+ has the win32process and win32api modules.
+
From Christian Maaser:
- Add support for Visual Studio Express Editions.
try:
import resource
except ImportError:
- def memory():
- return 0
+ try:
+ import win32process
+ import win32api
+ except ImportError:
+ def memory():
+ return 0
+ else:
+ def memory():
+ process_handle = win32api.GetCurrentProcess()
+ memory_info = win32process.GetProcessMemoryInfo( process_handle )
+ return memory_info['PeakWorkingSetSize']
else:
def memory():
res = resource.getrusage(resource.RUSAGE_SELF)
try:
import resource
except ImportError:
- x = "Python version has no 'resource' module; skipping tests.\n"
- test.skip_test(x)
+ try:
+ import win32process
+ import win32api
+ except ImportError:
+ x = "Python version has no 'resource' or 'win32api/win32process' module; skipping tests.\n"
+ test.skip_test(x)