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

Campbell Barton ideasman42 at gmail.com
Thu Jul 25 13:01:12 CEST 2013

This looks more like an error in libgeos, you should always be able to
call hasattr() on an object, Any errors raised should be real errors
in code which I think its correct to raise in the console too.
if the attribute can't be found and its not an error, then the library
should raise an attribute error and all will work without annoying

See Python developer discussion, this was an intentional change in python3.2

On Thu, Jul 25, 2013 at 8:31 PM, CND <cnd at gmx.ch> wrote:
> 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
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers

- Campbell

More information about the Bf-committers mailing list