Ensure builtins.SERVER_MODE is handled if running setup.py standalone.

This commit is contained in:
Dave Page 2017-08-25 11:56:44 +01:00
parent 507d8b3fe4
commit a65f7b330b

View File

@ -13,6 +13,16 @@ and settings database."""
import os
import sys
if sys.version_info[0] >= 3:
import builtins
else:
import __builtin__ as builtins
# Grab the SERVER_MODE if it's been set by the runtime
if 'SERVER_MODE' in globals():
builtins.SERVER_MODE = globals()['SERVER_MODE']
else:
builtins.SERVER_MODE = None
# We need to include the root directory in sys.path to ensure that we can
# find everything we need when running in the standalone runtime.