Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
rhettinger committed May 17, 2013
2 parents 4197221 + b37706f commit 5c71079
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions Lib/collections/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5c71079

Please sign in to comment.