cache = {}
def reset():
- """Reset the cache completely."""
- global cache
- cache = {}
+ """Reset the cache completely."""
+ global cache
+ cache = {}
def listdir(path):
"""List directory contents, using cache."""
def trace(context=1):
"""Return a list of records for the stack below the current exception."""
return getinnerframes(sys.exc_traceback, context)
-
-
children = []
for file in os.listdir(dir):
path = os.path.join(dir, file)
- if ispackage(path):
+ if ispackage(path):
children.append((path, package + (package and '.') + file))
else:
children.append((path, package))
""" % (cmd, os.sep, cmd, cmd, cmd, cmd, os.sep)
if __name__ == '__main__': cli()
-
-
class Foo:
count = 0
-
+
def __init__(self):
Foo.count += 1
def f2():
return x
f2()
-
+
for i in range(100):
f1()
verify(Foo.count == 0)
-
def http_error_401(self, req, fp, code, msg, headers):
host = urlparse.urlparse(req.get_full_url())[1]
- return self.http_error_auth_reqed('www-authenticate',
+ return self.http_error_auth_reqed('www-authenticate',
host, req, headers)
def http_error_407(self, req, fp, code, msg, headers):
host = req.get_host()
- return self.http_error_auth_reqed('proxy-authenticate',
+ return self.http_error_auth_reqed('proxy-authenticate',
host, req, headers)
endsep = "/"
else:
endsep = "."
-
+
def whichdb(filename):
"""Guess which db package to use to open a db file.