summaryrefslogtreecommitdiffstats
path: root/lib/python/sectracker/repo.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/repo.py
parenta0eedec07ab55e1a7ccf3b0892fe991150cef5b1 (diff)
Replace file() with open() for Python 3 compatability
Diffstat (limited to 'lib/python/sectracker/repo.py')
-rw-r--r--lib/python/sectracker/repo.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/python/sectracker/repo.py b/lib/python/sectracker/repo.py
index 7e6d454f51..bbe25822f6 100644
--- a/lib/python/sectracker/repo.py
+++ b/lib/python/sectracker/repo.py
@@ -132,7 +132,7 @@ class RepoCollection(object):
_os.makedirs(root)
l = _os.listdir(root)
if len(l) == 0:
- file(root + "/" + MARKER_NAME, "w").close()
+ open(root + "/" + MARKER_NAME, "w").close()
elif MARKER_NAME not in l:
raise ValueError("not a Debian repository mirror directory: "
+ repr(root))
@@ -197,7 +197,7 @@ class RepoCollection(object):
def release(self, name):
if name not in self.repos:
raise ValueError("name not registered: " + repr(name))
- with file(self._relname(name)) as f:
+ with open(self._relname(name)) as f:
return _parserelease(name, f)
def filemap(self, load=False):
@@ -255,7 +255,7 @@ class RepoCollection(object):
class Config(object):
def __init__(self, config, root):
- with file(config) as f:
+ with open(config) as f:
self.config = _cjson.decode(f.read())
self.repositories = self.config["repositories"]
self.distributions = self.config["distributions"]

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