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