Skip to content

Commit

Permalink
When completing attributes, use the __all__ attribute only for modules.
Browse files Browse the repository at this point in the history
pymongo uses an __all__ attribute for some of its objects, and it causes completion to fail.
  • Loading branch information
noamraph committed Dec 20, 2012
1 parent f4efd46 commit 4c28940
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dreampielib/subprocess/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,8 @@ def complete_attributes(self, expr):
ids = dir(entity)
ids = map(unicodify, ids)
ids.sort()
if hasattr(entity, '__all__'):
if (isinstance(entity, types.ModuleType)
and hasattr(entity, '__all__')):
all_set = set(entity.__all__)
else:
all_set = None
Expand Down

0 comments on commit 4c28940

Please sign in to comment.