Skip to content

Commit 4adbeeb

Browse files
committed
fix tests, getmembers doesn't return classmethod/staticmetnod objects.
Change-Id: I9449c6f3299f820fea4128cb598f39cf359cd9ef
1 parent 04776e2 commit 4adbeeb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

google/generativeai/client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -231,14 +231,14 @@ def make_client(self, name):
231231
def keep(name, f):
232232
if name.startswith("_"):
233233
return False
234-
elif not isinstance(f, types.FunctionType):
235-
return False
236-
elif isinstance(f, classmethod):
234+
235+
if not callable(f):
237236
return False
238-
elif isinstance(f, staticmethod):
237+
238+
if 'metadata' not in inspect.signature(f).parameters.keys():
239239
return False
240-
else:
241-
return True
240+
241+
return True
242242

243243
def add_default_metadata_wrapper(f):
244244
def call(*args, metadata=(), **kwargs):

0 commit comments

Comments
 (0)