@@ -159,7 +159,11 @@ def attach_amino_acid(selection,amino_acid,center=0,animate=-1,object="",hydro=-
159159 tmp [0 ] = str (tmp [0 ]- 1 ) # counting down
160160 _self .alter (tmp_editor ,"resi=tmp[0]" ,space = { 'tmp' : tmp })
161161 _self .set_geometry (tmp_connect , 3 , 3 ) # make nitrogen planar
162- _self .fuse ("(%s and name C)" % (tmp_editor ),tmp_connect ,2 )
162+ try :
163+ _self .fuse ("(%s and name C)" % (tmp_editor ),tmp_connect ,2 )
164+ except pymol .CmdException as e :
165+ _self .delete (tmp_wild )
166+ raise e
163167 _self .select (tmp_domain , "byresi (pk1 | pk2)" )
164168
165169 if not hydro :
@@ -211,7 +215,12 @@ def attach_amino_acid(selection,amino_acid,center=0,animate=-1,object="",hydro=-
211215 tmp [0 ] = str (tmp [0 ]+ 1 ) # counting up
212216 _self .alter (tmp_editor ,"resi=tmp[0]" ,space = { 'tmp' : tmp })
213217 _self .set_geometry (tmp_editor + " & name N" , 3 , 3 ) # make nitrogen planar
214- _self .fuse ("(%s and name N)" % tmp_editor ,tmp_connect ,2 )
218+ try :
219+ _self .fuse ("(%s and name N)" % tmp_editor ,tmp_connect ,2 )
220+ except pymol .CmdException as e :
221+ _self .delete (tmp_wild )
222+ raise e
223+
215224 _self .select (tmp_domain , "byresi (pk1 | pk2)" )
216225
217226 if not hydro :
0 commit comments