(proxy)
| 69 | |
| 70 | |
| 71 | def sync_proxy(proxy): |
| 72 | if object.__getattribute__(proxy, "_invalidated"): |
| 73 | raise InvalidationError("the proxy has been invalidated (the key was reassigned)") |
| 74 | shelf = object.__getattribute__(proxy, "_shelf") |
| 75 | key = object.__getattribute__(proxy, "_key") |
| 76 | obj = object.__getattribute__(proxy, "_obj") |
| 77 | shelf[key] = obj |
| 78 | shelf.sync() |
| 79 | |
| 80 | def open(*args): |
| 81 | return ShelfWrapper( shelve.open(*args) ) |
no test coverage detected