File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -721,13 +721,9 @@ def load_globals(hdf5_filename):
721721 raise LabscriptError ('Error whilst parsing globals from %s. \' %s\' ' % (hdf5_filename ,name ) +
722722 ' is a reserved Python keyword.' +
723723 ' Please choose a different variable name.' )
724- try :
725- assert '.' not in name
726- exec (name + ' = 0' )
727- exec ('del ' + name )
728- except :
729- raise LabscriptError ('ERROR whilst parsing globals from %s. \' %s\' ' % (hdf5_filename ,name ) +
730- 'is not a valid Python variable name.' +
724+ if not name .isidentifier ():
725+ raise LabscriptError ('Error whilst parsing globals from %s. \' %s\' ' % (hdf5_filename ,name ) +
726+ ' is not a valid Python variable name.' +
731727 ' Please choose a different variable name.' )
732728
733729 # Workaround for the fact that numpy.bool_ objects dont
You can’t perform that action at this time.
0 commit comments