Skip to content

Commit

Permalink
Avoid using eval, use getattr instead
Browse files Browse the repository at this point in the history
  • Loading branch information
c-bata committed May 20, 2019
1 parent 9b5c1f9 commit 225a0b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gunicorn/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,8 @@ def import_app(module):

is_debug = logging.root.level == logging.DEBUG
try:
app = eval(obj, vars(mod))
except NameError:
app = getattr(mod, obj)
except AttributeError:
if is_debug:
traceback.print_exception(*sys.exc_info())
raise AppImportError("Failed to find application object %r in %r" % (obj, module))
Expand Down

0 comments on commit 225a0b6

Please sign in to comment.