From: <pj...@us...> - 2008-07-31 18:47:37
|
Revision: 5029 http://jython.svn.sourceforge.net/jython/?rev=5029&view=rev Author: pjenvey Date: 2008-07-31 18:47:34 +0000 (Thu, 31 Jul 2008) Log Message: ----------- rearrange imports to fix test_threaded_import -- a bogus fix, but also what CPython did for this problem Modified Paths: -------------- branches/asm/Lib/os.py branches/asm/Lib/random.py Modified: branches/asm/Lib/os.py =================================================================== --- branches/asm/Lib/os.py 2008-07-31 16:14:55 UTC (rev 5028) +++ branches/asm/Lib/os.py 2008-07-31 18:47:34 UTC (rev 5029) @@ -46,7 +46,8 @@ import stat as _stat import sys from java.io import File -from org.python.core.io import FileDescriptors +from org.python.core import PyFile +from org.python.core.io import FileDescriptors, FileIO, IOBase # Mapping of: os._name: [name list, shell command list] _os_map = dict(nt=[ @@ -537,7 +538,6 @@ if rawio.closed(): raise OSError(errno.EBADF, errno.strerror(errno.EBADF)) - from org.python.core import PyFile try: fp = PyFile(rawio, '<fdopen>', mode, bufsize) except IOError: @@ -588,7 +588,6 @@ # Default to reading reading = True - from org.python.core.io import FileIO if truncating and not writing: # Explicitly truncate, writing will truncate anyway FileIO(filename, 'w').close() @@ -966,8 +965,6 @@ if isinstance(fileno, FileDescriptor): return _posix.isatty(fileno) - from org.python.core.io import IOBase - if not isinstance(fileno, IOBase): print fileno raise TypeError('a file descriptor is required') Modified: branches/asm/Lib/random.py =================================================================== --- branches/asm/Lib/random.py 2008-07-31 16:14:55 UTC (rev 5028) +++ branches/asm/Lib/random.py 2008-07-31 18:47:34 UTC (rev 5029) @@ -38,6 +38,7 @@ a single Python step, and is, therefore, threadsafe. """ +import time from types import BuiltinMethodType as _BuiltinMethodType from math import log as _log, exp as _exp, pi as _pi, e as _e from math import sqrt as _sqrt, acos as _acos, cos as _cos, sin as _sin @@ -96,7 +97,6 @@ """ if a is None: - import time a = long(time.time() * 256) # use fractional seconds super(Random, self).seed(a) self.gauss_next = None This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |