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

Fallback to the original behavior if prefix is not available (#1068) #1499

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Restore changes from original PR
  • Loading branch information
berkerpeksag committed Oct 31, 2017
commit 2b3088fb7259013e7136a58062f805bdebf3b098
12 changes: 7 additions & 5 deletions gunicorn/app/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,14 @@ def load_config_from_module_name_or_filename(self, location):
if location.startswith("python:"):
module_name = location[len("python:"):]
cfg = self.get_config_from_module_name(module_name)
else:
if location.startswith("file:"):
filename = location[len("file:"):]
else:
filename = location
elif location.startswith("file:"):
filename = location[len("file:"):]
cfg = self.get_config_from_filename(filename)
else:
try:
cfg = self.get_config_from_module_name(location)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we re-add that feature, wouldn’it be better to add the warning based kn the principle of least astonishment? Espacially since this chang re-add a behaviour removed 2 years ago. thoughts?

except ImportError:
cfg = self.get_config_from_filename(location)

for k, v in cfg.items():
# Ignore unknown names
Expand Down