File tree 1 file changed +8
-1
lines changed 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 112
112
IGNORE_COMMENT_PATTERN = re .compile ("(?:.* numpydoc ignore[=|:] ?)(.+)" )
113
113
114
114
115
+ def _unwrap (obj ):
116
+ """Iteratively traverse obj.__wrapped__ until first non-wrapped obj found."""
117
+ while hasattr (obj , "__wrapped__" ):
118
+ obj = obj .__wrapped__
119
+ return obj
120
+
121
+
115
122
# This function gets called once per function/method to be validated.
116
123
# We have to balance memory usage with performance here. It shouldn't be too
117
124
# bad to store these `dict`s (they should be rare), but to be safe let's keep
@@ -273,7 +280,7 @@ def is_function_or_method(self):
273
280
274
281
@property
275
282
def is_generator_function (self ):
276
- return inspect .isgeneratorfunction (self .obj )
283
+ return inspect .isgeneratorfunction (_unwrap ( self .obj ) )
277
284
278
285
@property
279
286
def source_file_name (self ):
You can’t perform that action at this time.
0 commit comments