self.name = []
self.already_checked = []
+ # Python 2
def visit_TryExcept(self, node):
for handler in node.handlers:
if handler.name:
else:
super(CheckForStrUnicodeExc, self).generic_visit(node)
+ # Python 3
+ def visit_ExceptHandler(self, node):
+ if node.name:
+ self.name.append(node.name)
+ super(CheckForStrUnicodeExc, self).generic_visit(node)
+ self.name = self.name[:-1]
+ else:
+ super(CheckForStrUnicodeExc, self).generic_visit(node)
+
def visit_Call(self, node):
if self._check_call_names(node, ['str', 'unicode']):
if node not in self.already_checked:
cinder.tests.unit.test_exception
cinder.tests.unit.test_glusterfs
cinder.tests.unit.test_gpfs
+cinder.tests.unit.test_hacking
cinder.tests.unit.test_hitachi_hbsd_horcm_fc
cinder.tests.unit.test_hitachi_hbsd_snm2_fc
cinder.tests.unit.test_hitachi_hbsd_snm2_iscsi