Description: use 'raise exception()' instead of simple 'raise'
Author: Piotr Ożarowski <piotr@debian.org>
Last-Update: 2010-06-30
Index: mgltools-molkit-1.5.4.cvs.20090603/MolKit/pdb2pqr/pdb2pka/NEWligand_topology.py
===================================================================
--- mgltools-molkit-1.5.4.cvs.20090603.orig/MolKit/pdb2pqr/pdb2pka/NEWligand_topology.py
+++ mgltools-molkit-1.5.4.cvs.20090603/MolKit/pdb2pqr/pdb2pka/NEWligand_topology.py
@@ -405,7 +405,7 @@ class get_ligand_topology:
self.biglist.append(real_list)
return
else:
- raise 'this should not happen'
+ raise Exception('this should not happen')
#
# -----
Index: mgltools-molkit-1.5.4.cvs.20090603/MolKit/pdb2pqr/pdb2pka/inputgen_pKa.py
===================================================================
--- mgltools-molkit-1.5.4.cvs.20090603.orig/MolKit/pdb2pqr/pdb2pka/inputgen_pKa.py
+++ mgltools-molkit-1.5.4.cvs.20090603/MolKit/pdb2pqr/pdb2pka/inputgen_pKa.py
@@ -136,7 +136,9 @@ class inputGen:
#
# Not a known type
#
- raise 'unknown type',type
+ # TODO: Exception() is used here instead of TypeError for backwards compatibility, fix it once sure that no TypeError is fine
+ #raise TypeError('unknown type',type)
+ raise Exception('unknown type',type)
return
def getText_sub(self):
@@ -165,7 +167,7 @@ class inputGen:
text += " nlev 4\n"
else:
- raise 'unknown method'
+ raise Exception('unknown method')
#
text += " mol 1\n"
text += " lpbe\n"
@@ -214,7 +216,7 @@ class inputGen:
#
# Eh?
#
- raise 'type not set'
+ raise Exception('type not set')
#
# ------
Index: mgltools-molkit-1.5.4.cvs.20090603/MolKit/pdb2pqr/pdb2pka/ligand_topology.py
===================================================================
--- mgltools-molkit-1.5.4.cvs.20090603.orig/MolKit/pdb2pqr/pdb2pka/ligand_topology.py
+++ mgltools-molkit-1.5.4.cvs.20090603/MolKit/pdb2pqr/pdb2pka/ligand_topology.py
@@ -399,7 +399,7 @@ class get_ligand_topology:
self.biglist.append(real_list)
return
else:
- raise 'this should not happen'
+ raise Exception('this should not happen')
#
# -----
Index: mgltools-molkit-1.5.4.cvs.20090603/MolKit/pdb2pqr/pdb2pka/ligandclean/ligff.py
===================================================================
--- mgltools-molkit-1.5.4.cvs.20090603.orig/MolKit/pdb2pqr/pdb2pka/ligandclean/ligff.py
+++ mgltools-molkit-1.5.4.cvs.20090603/MolKit/pdb2pqr/pdb2pka/ligandclean/ligff.py
@@ -354,7 +354,7 @@ class ligand_charge_handler(MOL2MOLECULE
if BondiiRadiiDict.has_key(ele):
radius = BondiiRadiiDict[ele]
else:
- raise 'radius not known for',ele
+ raise Exception('radius not known for',ele)
#
# Store the radii and charges
#
Index: mgltools-molkit-1.5.4.cvs.20090603/MolKit/pdb2pqr/pdb2pka/pka.py
===================================================================
--- mgltools-molkit-1.5.4.cvs.20090603.orig/MolKit/pdb2pqr/pdb2pka/pka.py
+++ mgltools-molkit-1.5.4.cvs.20090603/MolKit/pdb2pqr/pdb2pka/pka.py
@@ -867,7 +867,7 @@ class pKaRoutines:
if abs(totphi)<0.01 or abs(totcrg)<0.01:
print 'total abs phi',totphi
print 'total abs crg',totcrg
- raise 'Something is rotten'
+ raise Exception('Something is rotten')
print
print
return energy
@@ -1071,7 +1071,7 @@ class pKaRoutines:
#
if get_neutral_state:
if not neutral_state:
- raise "no neutral state for",residue.resSeq
+ raise Exception("no neutral state for",residue.resSeq)
return neutral_state
#
# Make sure that the charges add up to integers by adding extra atoms
@@ -1129,7 +1129,7 @@ class pKaRoutines:
if added is None and sum>0.001:
print sum
print atomnames
- raise 'Could not find integer charge state'
+ raise Exception('Could not find integer charge state')
return atomnames
#