From b16e31143ee3da3eec58086dda049944c5172729 Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Nov 02 2017 11:38:16 +0000 Subject: Use open() instead of file() for opening files open() is preffered way how to open files in Python and file() is not available in Python 3. Signed-off-by: Lumir Balhar --- diff --git a/src/fedora-hosted.py b/src/fedora-hosted.py index caca630..dc97ff3 100755 --- a/src/fedora-hosted.py +++ b/src/fedora-hosted.py @@ -62,7 +62,7 @@ def getOtherConfiguration(opts): # Look for configuration in the local git configuration proc = subprocess.Popen('git rev-parse --git-dir', - stdout=file("/dev/null", 'w'), shell=True) + stdout=open("/dev/null", 'w'), shell=True) ret = os.WEXITSTATUS(os.waitpid(proc.pid, 0)[1]) if ret == 0: raw_value = subprocess.Popen(['git', 'config', diff --git a/src/fedora_cert/__init__.py b/src/fedora_cert/__init__.py index 604d39a..32ad625 100644 --- a/src/fedora_cert/__init__.py +++ b/src/fedora_cert/__init__.py @@ -91,7 +91,7 @@ def read_user_cert(): """ if os.path.exists(os.path.expanduser('~/.fedora.upn')): - with file(os.path.expanduser('~/.fedora.upn'), 'r') as f: + with open(os.path.expanduser('~/.fedora.upn'), 'r') as f: return f.read().replace('\n', '') my_cert = _open_cert()