Skip to content

Commit 1b1bf30

Browse files
committed
ENH: Remove unused variable warnings.
1 parent 0c4269c commit 1b1bf30

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

Wrapping/Generators/Python/itkExtras.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ def _GetArrayFromImage(image_or_filter, function, keep_axes, update):
261261
keys = [k for k in itk.PyBuffer.keys() if k[0] == output(image_or_filter).__class__]
262262
if len(keys) == 0:
263263
raise RuntimeError("No suitable template parameter can be found.")
264-
ImageType = keys[0]
265264
# Create a numpy array of the type of the input image
266265
templatedFunction = getattr(itk.PyBuffer[keys[0]], function)
267266
return templatedFunction(output(image_or_filter), keep_axes, update)
@@ -1145,11 +1144,7 @@ def __iter__(self):
11451144
yield k
11461145

11471146
def has_key(self, key):
1148-
try:
1149-
value = self[key]
1150-
except KeyError:
1151-
return False
1152-
return True
1147+
return key in self.__templates__
11531148

11541149
def __contains__(self, key):
11551150
return key in self

0 commit comments

Comments
 (0)