Remove exec() from atom.py
This commit is contained in:
@@ -290,8 +290,9 @@ class Atom(object):
|
|||||||
self.occ = self.occ.replace('LG', 'non_titratable_ligand')
|
self.occ = self.occ.replace('LG', 'non_titratable_ligand')
|
||||||
# try to initialise the group
|
# try to initialise the group
|
||||||
try:
|
try:
|
||||||
# TODO - get rid of this exec() statement for security reasons
|
group_attr = "%s_group" % self.occ
|
||||||
exec('self.group = propka.group.%s_group(self)' % self.occ)
|
group_attr = getattr(propka.group, group_attr)
|
||||||
|
self.group = group_attr(self)
|
||||||
except:
|
except:
|
||||||
raise Exception('%s in input_file is not recognized as a group' % self.occ)
|
raise Exception('%s in input_file is not recognized as a group' % self.occ)
|
||||||
# set the model pKa value
|
# set the model pKa value
|
||||||
|
|||||||
Reference in New Issue
Block a user