Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for versions of dev_appserver that don't have fix_sys_path #12

Merged
merged 1 commit into from Oct 18, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion endpoints/_endpointscfg_setup.py
Expand Up @@ -50,6 +50,12 @@
valid SDK root.""".strip()


_NO_FIX_SYS_PATH_WARNING = """
Could not find the fix_sys_path() function in dev_appserver.
If you encounter errors, please make sure that your Google App Engine SDK is
up-to-date.""".strip()


def _FindSdkPath():
environ_sdk = os.environ.get('ENDPOINTS_GAE_SDK')
if environ_sdk:
Expand Down Expand Up @@ -82,7 +88,10 @@ def _SetupPaths():
sys.path.append(sdk_path)
try:
import dev_appserver # pylint: disable=g-import-not-at-top
dev_appserver.fix_sys_path()
if hasattr(dev_appserver, 'fix_sys_path'):
dev_appserver.fix_sys_path()
else:
logging.warning(_NO_FIX_SYS_PATH_WARNING)
except ImportError:
logging.warning(_IMPORT_ERROR_WARNING)
else:
Expand Down