yield k
def has_key(self, key):
try:
- value = self[key]
+ self[key]
except KeyError:
return False
return True
def exists(path):
"""Test whether a path exists. Returns False for broken symbolic links"""
try:
- st = os.stat(path)
+ os.stat(path)
except os.error:
return False
return True
if __name__ == '__main__':
- import sys
import getopt
USAGE = """\
def lexists(path):
"""Test whether a path exists. Returns True for broken symbolic links"""
try:
- st = os.lstat(path)
+ os.lstat(path)
except os.error:
return False
return True
m.open = m.file = self.r_open
def make_main(self):
- m = self.add_module('__main__')
+ self.add_module('__main__')
def make_osname(self):
osname = os.name
"""Wait for child process to terminate. Returns returncode
attribute."""
if self.returncode is None:
- obj = WaitForSingleObject(self._handle, INFINITE)
+ WaitForSingleObject(self._handle, INFINITE)
self.returncode = GetExitCodeProcess(self._handle)
return self.returncode
import warnings
-from functools import wraps
from time import time as _time, sleep as _sleep
from traceback import format_exc as _format_exc
from collections import deque
hdrs = fp.info()
fp.close()
return url2pathname(splithost(url1)[1]), hdrs
- except IOError, msg:
+ except IOError:
pass
fp = self.open(url, data)
try:
else:
try:
# is this a sufficient test for sequence-ness?
- x = len(v)
+ len(v)
except TypeError:
# not a sequence
v = quote_plus(str(v))