Show More
@@ -209,10 +209,14 b' class Completer:' | |||||
209 |
|
209 | |||
210 | # this is the 'dir' function for objects with Enthought's traits |
|
210 | # this is the 'dir' function for objects with Enthought's traits | |
211 | if hasattr(object, 'trait_names'): |
|
211 | if hasattr(object, 'trait_names'): | |
212 | words.extend(object.trait_names()) |
|
212 | try: | |
213 | # eliminate possible duplicates, as some traits may also appear as |
|
213 | words.extend(object.trait_names()) | |
214 | # normal attributes in the dir() call. |
|
214 | # eliminate possible duplicates, as some traits may also | |
215 | words = set(words) |
|
215 | # appear as normal attributes in the dir() call. | |
|
216 | words = set(words) | |||
|
217 | except TypeError: | |||
|
218 | # This will happen if `object` is a class and not an instance. | |||
|
219 | pass | |||
216 |
|
220 | |||
217 | # filter out non-string attributes which may be stuffed by dir() calls |
|
221 | # filter out non-string attributes which may be stuffed by dir() calls | |
218 | # and poor coding in third-party modules |
|
222 | # and poor coding in third-party modules |
General Comments 0
You need to be logged in to leave comments.
Login now