mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-15 08:21:31 +00:00
Reformat everything.
This commit is contained in:
parent
3f2213791a
commit
340ff8586d
1008 changed files with 61301 additions and 58309 deletions
7
plugins/cache/pickle.py
vendored
7
plugins/cache/pickle.py
vendored
|
|
@ -51,14 +51,15 @@ class CacheModule(BaseFileCacheModule):
|
|||
"""
|
||||
A caching module backed by pickle files.
|
||||
"""
|
||||
|
||||
_persistent = False # prevent unnecessary JSON serialization and key munging
|
||||
|
||||
def _load(self, filepath):
|
||||
# Pickle is a binary format
|
||||
with open(filepath, 'rb') as f:
|
||||
return pickle.load(f, encoding='bytes')
|
||||
with open(filepath, "rb") as f:
|
||||
return pickle.load(f, encoding="bytes")
|
||||
|
||||
def _dump(self, value, filepath):
|
||||
with open(filepath, 'wb') as f:
|
||||
with open(filepath, "wb") as f:
|
||||
# Use pickle protocol 2 which is compatible with Python 2.3+.
|
||||
pickle.dump(value, f, protocol=2)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue