mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
Use global statement instead of importing ourselves to get to global
variable.
This commit is contained in:
parent
453ced57dc
commit
e5fe4af070
1 changed files with 2 additions and 6 deletions
|
@ -22,14 +22,10 @@ def stat(path):
|
||||||
|
|
||||||
|
|
||||||
# Reset the cache completely.
|
# Reset the cache completely.
|
||||||
# Hack: to reset a global variable, we import this module.
|
|
||||||
#
|
#
|
||||||
def reset():
|
def reset():
|
||||||
import statcache
|
global cache
|
||||||
# Check that we really imported the same module
|
cache = {}
|
||||||
if cache is not statcache.cache:
|
|
||||||
raise 'sorry, statcache identity crisis'
|
|
||||||
statcache.cache = {}
|
|
||||||
|
|
||||||
|
|
||||||
# Remove a given item from the cache, if it exists.
|
# Remove a given item from the cache, if it exists.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue