From 930f110872cae27d4b83b2a4d2780587adedf0fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sun, 19 Jan 2020 17:55:45 +0100 Subject: [PATCH] python3: replace execfile usage --- debian/debian_config.py | 4 ++-- scrutiny/settings.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/debian_config.py b/debian/debian_config.py index 64b6ced..c04b78c 100644 --- a/debian/debian_config.py +++ b/debian/debian_config.py @@ -7,7 +7,7 @@ PROJECT_NAME = 'scrutiny' DEBUG = False TEMPLATE_DEBUG = False -SECRET_KEY = file('/etc/%s/secret' % PROJECT_NAME).read() +SECRET_KEY = open('/etc/%s/secret' % PROJECT_NAME).read() ADMINS = ( ('Tous', 'root@localhost'), @@ -39,4 +39,4 @@ DATABASES = { # # local settings # -execfile(os.path.join(ETC_DIR, 'settings.py')) +exec(open(os.path.join(ETC_DIR, 'settings.py')).read()) diff --git a/scrutiny/settings.py b/scrutiny/settings.py index 6466b85..7b0bd17 100644 --- a/scrutiny/settings.py +++ b/scrutiny/settings.py @@ -148,4 +148,4 @@ REDMINE_API_KEY = None local_settings_file = os.environ.get('SCRUTINY_SETTINGS_FILE', os.path.join(os.path.dirname(__file__), 'local_settings.py')) if os.path.exists(local_settings_file): - execfile(local_settings_file) + exec(open(local_settings_file).read())