Commit b37706f3 authored by Raymond Hettinger's avatar Raymond Hettinger

Remove unnecessary exception handler.

parent 0fe236b7
......@@ -363,10 +363,7 @@ def namedtuple(typename, field_names, verbose=False, rename=False):
# Execute the template string in a temporary namespace and support
# tracing utilities by setting a value for frame.f_globals['__name__']
namespace = dict(__name__='namedtuple_%s' % typename)
try:
exec(class_definition, namespace)
except SyntaxError as e:
raise SyntaxError(e.msg + ':\n\n' + class_definition)
exec(class_definition, namespace)
result = namespace[typename]
result._source = class_definition
if verbose:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment