From dbeca9f785cb90139fde37ad0aaad61f70b5506f Mon Sep 17 00:00:00 2001 From: Brian May Date: Mon, 4 Mar 2019 17:21:45 +1100 Subject: Replace file() with open() for Python 3 compatability --- lib/python/debian_support.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/python/debian_support.py') diff --git a/lib/python/debian_support.py b/lib/python/debian_support.py index 8bece17da3..8657be82f2 100644 --- a/lib/python/debian_support.py +++ b/lib/python/debian_support.py @@ -131,7 +131,7 @@ class PackageFile: file with the indicated name. """ if fileObj is None: - fileObj = file(name) + fileObj = open(name) self.name = name self.file = fileObj self.lineno = 0 @@ -274,7 +274,7 @@ def replaceFile(lines, local): import os.path local_new = local + '.new' - new_file = file(local_new, 'w+') + new_file = open(local_new, 'w+') try: for l in lines: @@ -318,7 +318,7 @@ def updateFile(remote, local, verbose=None): """ try: - local_file = file(local) + local_file = open(local) except IOError: if verbose: print("updateFile: no local copy, downloading full file") @@ -521,7 +521,7 @@ def getconfig(): global _config if _config is not None: return _config - _config = json.load(file(findresource("data", "config.json"))) + _config = json.load(open(findresource("data", "config.json"))) return _config _releasecodename = None -- cgit v1.2.3