1. PyPA
  2. Python Packaging Authority Projects
  3. setuptools

Commits

Jason R. Coombs  committed 2649fd3

Translate NameError into SyntaxError to meet prescribed API

  • Participants
  • Parent commits 5e53e8f
  • Branches default

Comments (0)

Files changed (1)

File pkg_resources.py

View file
     for key in env.keys():
         new_key = key.replace('.', '_')
         env[new_key] = env.pop(key)
-    return _markerlib.interpret(text, env)
+    try:
+        result = _markerlib.interpret(text, env)
+    except NameError:
+        e = sys.exc_info()[1]
+        raise SyntaxError(e.args[0])
+    return result
 
 # support marker evaluation on Python 2.4+
 if sys.version_info < (2,6) and _pyimp() == 'CPython':