1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-01 01:46:18 +00:00

[PR #10873/6cd46654 backport][stable-11] Avoid six in plugin code (#10875)

Avoid six in plugin code (#10873)

Avoid six in plugin code.

(cherry picked from commit 6cd4665412)

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
patchback[bot] 2025-10-05 07:36:47 +02:00 committed by GitHub
parent 3b207ba0fd
commit 1e01aeacb4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 70 additions and 120 deletions

View file

@ -48,7 +48,6 @@ try:
except ImportError:
import pickle
from ansible.module_utils.six import PY3
from ansible.plugins.cache import BaseFileCacheModule
@ -61,10 +60,7 @@ class CacheModule(BaseFileCacheModule):
def _load(self, filepath):
# Pickle is a binary format
with open(filepath, 'rb') as f:
if PY3:
return pickle.load(f, encoding='bytes')
else:
return pickle.load(f)
return pickle.load(f, encoding='bytes')
def _dump(self, value, filepath):
with open(filepath, 'wb') as f: