Skip to content

Commit

Permalink
Use dir() instead of inspect.getmembers() to get available methods of…
Browse files Browse the repository at this point in the history
… the object

Ref: google#149
  • Loading branch information
meshde committed Nov 6, 2018
1 parent 5e25899 commit c5d06b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fire/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ def _GetMember(component, args):
Raises:
FireError: If we cannot consume an argument to get a member.
"""
members = dict(inspect.getmembers(component))
members = dir(component)
arg = args[0]
arg_names = [
arg,
Expand All @@ -568,7 +568,7 @@ def _GetMember(component, args):

for arg_name in arg_names:
if arg_name in members:
return members[arg_name], [arg], args[1:]
return getattr(component, arg_name), [arg], args[1:]

raise FireError('Could not consume arg:', arg)

Expand Down

0 comments on commit c5d06b3

Please sign in to comment.