summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2020-01-19 18:04:15 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2020-03-17 18:06:44 (GMT)
commit4f9bb8b1617b97dcb57a1ab01aeefa1de7521eb4 (patch)
treec8027a1a3daba88d0a17210fe58fb3b319398c3e
parentf165c7d12d195f8c70e511753b8eb46c8de5dbb4 (diff)
downloadwelco-4f9bb8b1617b97dcb57a1ab01aeefa1de7521eb4.zip
welco-4f9bb8b1617b97dcb57a1ab01aeefa1de7521eb4.tar.gz
welco-4f9bb8b1617b97dcb57a1ab01aeefa1de7521eb4.tar.bz2
python3: use exec(open(... to replace execfile (#39092)
-rw-r--r--debian/debian_config.py8
-rw-r--r--debian/settings.py3
-rw-r--r--welco/settings.py2
3 files changed, 7 insertions, 6 deletions
diff --git a/debian/debian_config.py b/debian/debian_config.py
index 9d91f2c..34cf33f 100644
--- a/debian/debian_config.py
+++ b/debian/debian_config.py
@@ -1,4 +1,4 @@
-# This file is sourced by "execfile" from welco.settings
+# This file is sourced by "exec(open(..." from welco.settings
import os
@@ -10,12 +10,12 @@ INSTALLED_APPS += ('mellon',)
#
# hobotization (multitenant)
#
-execfile('/usr/lib/hobo/debian_config_common.py')
+exec(open('/usr/lib/hobo/debian_config_common.py').read())
#
# local settings
#
-execfile(os.path.join(ETC_DIR, 'settings.py'))
+exec(open(os.path.join(ETC_DIR, 'settings.py')).read())
# run additional settings snippets
-execfile('/usr/lib/hobo/debian_config_settings_d.py')
+exec(open('/usr/lib/hobo/debian_config_settings_d.py').read())
diff --git a/debian/settings.py b/debian/settings.py
index 42779e4..a7a2c6f 100644
--- a/debian/settings.py
+++ b/debian/settings.py
@@ -9,7 +9,8 @@
# WARNING! Quick-start development settings unsuitable for production!
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
-# This file is sourced by "execfile" from /usr/lib/welco/debian_config.py
+# This file is sourced by "exec(open(...).read())" from
+# /usr/lib/welco/debian_config.py
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
diff --git a/welco/settings.py b/welco/settings.py
index f5643f6..2a3ac3b 100644
--- a/welco/settings.py
+++ b/welco/settings.py
@@ -220,4 +220,4 @@ REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] = ['rest_framework.authenticati
local_settings_file = os.environ.get('WELCO_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())