summaryrefslogtreecommitdiffstats
path: root/lib/python/sectracker/xpickle.py
diff options
context:
space:
mode:
authorBrian May <brian@linuxpenguins.xyz>2019-03-04 17:21:45 +1100
committerBrian May <brian@linuxpenguins.xyz>2019-03-04 17:31:32 +1100
commitdbeca9f785cb90139fde37ad0aaad61f70b5506f (patch)
treefaa44ee8494b4adb0d54a3f990cc7f1b2a4c16f0 /lib/python/sectracker/xpickle.py
parenta0eedec07ab55e1a7ccf3b0892fe991150cef5b1 (diff)
Replace file() with open() for Python 3 compatability
Diffstat (limited to 'lib/python/sectracker/xpickle.py')
-rw-r--r--lib/python/sectracker/xpickle.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/python/sectracker/xpickle.py b/lib/python/sectracker/xpickle.py
index 9a7296e4cc..78a8e95075 100644
--- a/lib/python/sectracker/xpickle.py
+++ b/lib/python/sectracker/xpickle.py
@@ -63,7 +63,7 @@ def _wraploader(typ, parser):
def safeload(path):
try:
- with file(path + EXTENSION) as f:
+ with open(path + EXTENSION, "rb") as f:
return (_pickle.load(f), True)
except (EOFError, IOError, _pickle.PickleError):
return (None, False)
@@ -78,7 +78,7 @@ def _wraploader(typ, parser):
return (None, False)
def reparse(path, st):
- with file(path) as f:
+ with open(path) as f:
obj = parser(path, f)
data = _pickle.dumps(
((typ, st.st_size, st.st_mtime, st.st_ino), obj), -1)

© 2014-2024 Faster IT GmbH | imprint | privacy policy