]> granicus.if.org Git - python/commitdiff
Use global statement instead of importing ourselves to get to global
authorSjoerd Mullender <sjoerd@acm.org>
Thu, 7 Dec 1995 10:16:45 +0000 (10:16 +0000)
committerSjoerd Mullender <sjoerd@acm.org>
Thu, 7 Dec 1995 10:16:45 +0000 (10:16 +0000)
variable.

Lib/statcache.py

index 04381f3861591c0603b9f6455feddf7aa9708cff..770aef0662f4d502bee54e031d1217f2d34ae05f 100644 (file)
@@ -22,14 +22,10 @@ def stat(path):
 
 
 # Reset the cache completely.
-# Hack: to reset a global variable, we import this module.
 #
 def reset():
-       import statcache
-       # Check that we really imported the same module
-       if cache is not statcache.cache:
-               raise 'sorry, statcache identity crisis'
-       statcache.cache = {}
+       global cache
+       cache = {}
 
 
 # Remove a given item from the cache, if it exists.