mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Remove unnecessary exception handler.
This commit is contained in:
parent
0fe236b734
commit
b37706f306
1 changed files with 1 additions and 4 deletions
|
@ -363,10 +363,7 @@ def namedtuple(typename, field_names, verbose=False, rename=False):
|
||||||
# Execute the template string in a temporary namespace and support
|
# Execute the template string in a temporary namespace and support
|
||||||
# tracing utilities by setting a value for frame.f_globals['__name__']
|
# tracing utilities by setting a value for frame.f_globals['__name__']
|
||||||
namespace = dict(__name__='namedtuple_%s' % typename)
|
namespace = dict(__name__='namedtuple_%s' % typename)
|
||||||
try:
|
exec(class_definition, namespace)
|
||||||
exec(class_definition, namespace)
|
|
||||||
except SyntaxError as e:
|
|
||||||
raise SyntaxError(e.msg + ':\n\n' + class_definition)
|
|
||||||
result = namespace[typename]
|
result = namespace[typename]
|
||||||
result._source = class_definition
|
result._source = class_definition
|
||||||
if verbose:
|
if verbose:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue