File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Wrapping/Generators/Python Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -340,11 +340,11 @@ def __getitem__(self, parameters):
340
340
341
341
try :
342
342
return self .__template__ [tuple (cleanParameters )]
343
- except :
343
+ except KeyError :
344
344
self ._LoadModules ()
345
345
try :
346
346
return self .__template__ [tuple (cleanParameters )]
347
- except :
347
+ except KeyError :
348
348
raise TemplateTypeError (self , tuple (cleanParameters ))
349
349
350
350
def __repr__ (self ):
@@ -793,12 +793,15 @@ def progress():
793
793
callback (name , self .GetProgress ())
794
794
795
795
self .AddObserver (itk .ProgressEvent (), progress )
796
- except :
797
- # it seems that something goes wrong...
796
+ except AttributeError :
798
797
# as this feature is designed for prototyping, it's not really a
799
798
# problem if an object doesn't have progress reporter, so adding
800
799
# reporter can silently fail
801
800
pass
801
+ except Exception :
802
+ # it seems that something else has gone wrong...
803
+ # silently fail to maintain backward compatibility
804
+ pass
802
805
803
806
if itkConfig .NotInPlace and "SetInPlace" in dir (self ):
804
807
self .SetInPlace (False )
You can’t perform that action at this time.
0 commit comments