[Scons-users] Creating a class in a SConscript

Dynastic Space dynasticspace at gmail.com
Thu May 4 15:05:37 EDT 2017

I have a python script defining a hierarchy of classes. This script is not
part of the scons environment.

In a SConscript file I derive from one of the classes defined in my script.

I store an instance of the new class in the environment, to access it later
in my script.
However, when I use isinstance(instance, MyParentClass) it returns False.

See the following print:
binary: app type: <class 'SCons.Script.MyAppBinaryDesc'> instance of
AppBinaryDesc: False hierarchy: (<class 'SCons.Script.MyBinaryDesc'>,
<class 'binary_descriptor.SPAppBinaryDesc'>, <class
'binary_descriptor.AppBinaryDesc'>, <class
'binary_descriptor.BuildableDesc'>, <class 'binary_descriptor.BinaryDesc'>,
<type 'object'>)

The instantiated object is app.
The class that was instantiated in my SConscript is MyAppBinaryDesc.
I use isinstance(app, AppBinaryDesc) which returns False.

I expect it to return 'True', as the hierarchy clearly shows
MyAppBinaryDesc inheriting from AppBinaryDesc.

I tried importing SCons.Script in my script, but that did not help.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20170504/f2b82d15/attachment.html>

More information about the Scons-users mailing list