From 7f6dc3f3df5572be1b7a70ce34aff8dd20f62054 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Sun, 17 Dec 2017 13:52:00 +0100 Subject: [PATCH] Python 2+3 --- wsgi.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wsgi.py b/wsgi.py index 8423557..93d4c89 100644 --- a/wsgi.py +++ b/wsgi.py @@ -1,9 +1,11 @@ # Activate virtualenv import settings -#activate_this = getattr(settings, 'VENV', None) +activate_this = getattr(settings, 'VENV', None) +# FIXME: python 2 *and* python 3 compatibility +# Python 2 #if activate_this: # execfile(activate_this, dict(__file__=activate_this)) -activate_this = getattr(settings, 'VENV', None) +# Python 3 with open(activate_this) as file_: exec(file_.read(), dict(__file__=activate_this))