Use in syntax for key lookup for Python 3 compatibility

This commit is contained in:
Richard Berger 2017-05-15 17:34:48 -04:00
parent 6a1f7e61f2
commit 93cc6f4a5d
1 changed files with 1 additions and 1 deletions

View File

@ -12,7 +12,7 @@ class LAMMPSLJCutPotential(object):
'NULL': (0.0,1.0, 0.0, 0.0,0.0,0.0)}}
def map_coeff(self,name,type):
if self.coeff.has_key(name):
if name in self.coeff:
self.pmap[type] = name
else:
raise Exception("cannot match atom type %s" % name)