[Bf-committers] python autocompletion "broken" with libgeos library

CND cnd at gmx.ch
Thu Jul 25 12:31:35 CEST 2013


Hi,

Could we consider altering the code of rlcompleter.py at line 142? Could we just put the hasattr() statement in a try-except-clause like this: ?

            try:
                if word[:n] == attr and hasattr(thisobject, word):
                    val = getattr(thisobject, word)
                    word = self._callable_postfix(val, "%s.%s" % (expr, word))
                    matches.append(word)
            except:
                pass

The reason: I try to port the shapely wrapper for libgeos to python 3.3. I think (hope) it worked pretty well so far. But while testing it with the autocompletion I got errors, since shapely raises exceptions for a few functions that are - by intention - not implemented for a few parent classes.

So, if anybody wants to test the wrapper too: https://github.com/ctrl-cmd/shapely

Cheers,
Lukas


More information about the Bf-committers mailing list