update to nwgeom.py to fix NoneType error.

None is returned by rtdb_get(name) if name is not in the rtdb variables. This leads to failure of the previous behaviour which expects NWChemError to be raised.
This commit is contained in:
Mark Driver 2020-06-17 18:09:12 +01:00
parent 1c72592ee9
commit bec27a0cd3

View file

@ -11,6 +11,8 @@ def geom_get_coords(name):
actualname = rtdb_get(name)
except NWChemError:
actualname = name
if actualname is None:
actualname = name
coords = rtdb_get('geometry:' + actualname + ':coords')
units = rtdb_get('geometry:'+actualname+':user units')
if (units == 'a.u.'):
@ -35,6 +37,8 @@ def geom_set_coords(name,coords):
actualname = rtdb_get(name)
except NWChemError:
actualname = name
if actualname is None:
actualname = name
units = rtdb_get('geometry:'+actualname+':user units')
if (units == 'a.u.'):
factor = 1.0