diff win32.py @ 85:741ae3391b61

Moved clock/time detection into platform-specific modules and testcases
author Oleg Oshmyan <chortos@inbox.lv>
date Thu, 24 Feb 2011 23:59:48 +0000
parents 06356af50bf9
children c62c9bfd614a
line wrap: on
line diff
--- a/win32.py	Thu Feb 24 00:29:32 2011 +0000
+++ b/win32.py	Thu Feb 24 23:59:48 2011 +0000
@@ -14,7 +14,11 @@
 from ctypes.wintypes import *
 from msvcrt import getch as pause
 from subprocess import Popen
-from __main__ import clock
+
+try:
+	from testcases import clock
+except ImportError:
+	from time import clock
 
 # Defaults that may be overwritten by values from _subprocess
 INFINITE = -1
@@ -43,7 +47,7 @@
 else:
 	ProcessTimes = namedtuple('ProcessTimes', 'kernel user')
 
-__all__ = 'call', 'kill', 'terminate', 'pause'
+__all__ = 'call', 'kill', 'terminate', 'pause', 'clock'
 
 
 # Automatically convert _subprocess handle objects into low-level HANDLEs