Skip to content

Commit 27657f1

Browse files
even better test exception handling
1 parent c773407 commit 27657f1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/tests/arithmetic/test_datetime64.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2373,9 +2373,10 @@ class FakeDatetime(MetaDatetime("NewBase", (datetime,), {})):
23732373
if (mod_name == __name__ or
23742374
module.__name__ in ('datetime',)):
23752375
continue
2376+
module_attributes = dir(module)
23762377
except (ImportError, AttributeError, TypeError):
23772378
continue
2378-
for attribute_name in dir(module):
2379+
for attribute_name in module_attributes:
23792380
try:
23802381
attribute_value = getattr(module, attribute_name)
23812382
except (ImportError, AttributeError, TypeError):

0 commit comments

Comments
 (0)