Explorar el Código

Avoid hasattr.

Jelmer Vernooij hace 9 años
padre
commit
71f831ba66
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      dulwich/tests/test_repository.py

+ 1 - 1
dulwich/tests/test_repository.py

@@ -126,7 +126,7 @@ class RepositoryRootTests(TestCase):
             self.assertEqual(k in r, contained)
 
         # Avoid deprecation warning under Py3.2+
-        if hasattr(self, 'assertRaisesRegex'):
+        if getattr(self, 'assertRaisesRegex', None):
             assertRaisesRegexp = self.assertRaisesRegex
         else:
             assertRaisesRegexp = self.assertRaisesRegexp