GafferHQ / gaffer

Gaffer is a node-based application for lookdev, lighting and automation
http://www.gafferhq.org
BSD 3-Clause "New" or "Revised" License
930 stars 206 forks source link

SystemError : line 1 : error return without exception set #477

Open bentoogood opened 10 years ago

bentoogood commented 10 years ago

I have a case where I am getting back an odd 'error without exception'. in the example eval-ing boo will raise the error, where as I can remove part of the string and the error goes away (foo)

boo = "GafferUI.CompoundEditor( scriptNode, children = ( GafferUI.SplitContainer.Orientation.Horizontal, 0.413288, ( ( GafferUI.SplitContainer.Orientation.Vertical, 0.500514, ( {'tabs': (GafferUI.Viewer( scriptNode ),), 'currentTab': 0}, {'tabs': (GafferUI.NodeGraph( scriptNode ),), 'currentTab': 0} ) ), ( GafferUI.SplitContainer.Orientation.Vertical, 0.194245, ( {'tabs': (GafferUI.NodeEditor( scriptNode ), GafferSceneUI.SceneHierarchy( scriptNode )), 'currentTab': 1}, {'tabs': (GafferUI.ScriptEditor( scriptNode ),), 'currentTab': 0} ) ) ) ) )"

foo = "GafferUI.CompoundEditor( scriptNode, children = ( GafferUI.SplitContainer.Orientation.Horizontal, 0.413288, ( ( GafferUI.SplitContainer.Orientation.Vertical, 0.500514, ( {'tabs': (GafferUI.Viewer( scriptNode ),), 'currentTab': 0}, {'tabs': (GafferUI.NodeGraph( scriptNode ),), 'currentTab': 0} ) ), ( GafferUI.SplitContainer.Orientation.Vertical, 0.194245, ( {'tabs': (GafferUI.NodeEditor( scriptNode ),), 'currentTab': 0}, {'tabs': (GafferUI.ScriptEditor( scriptNode ),), 'currentTab': 0} ) ) ) ) )"

layout = eval(boo)
layout = eval(foo)
bentoogood commented 10 years ago

Required to get all the autogenerated screen grabs working properly.

johnhaddon commented 10 years ago

It seems that this only occurs with PyQt builds, and not PySide builds.

bentoogood commented 10 years ago

Working round this by using the public PySide build to create the documentation screen grabs.

davidsminor commented 9 years ago

aha - you know what? The difference between the two strings is the presence of a GafferSceneUI.SceneHierarchy. If I modify the misbehaving string slightly like so:

eval( """
GafferUI.CompoundEditor(
    scriptNode, children =
    (
        GafferUI.SplitContainer.Orientation.Horizontal, 0.413288,
        (
            (
                GafferUI.SplitContainer.Orientation.Vertical, 0.500514,
                (
                    {'tabs': ()},
                    {'tabs': ()}
                    #{'tabs': (GafferUI.Viewer( scriptNode ),), 'currentTab': 0},
                    #{'tabs': (GafferUI.NodeGraph( scriptNode ),), 'currentTab': 0}
                )
            ),
             (
                GafferUI.SplitContainer.Orientation.Vertical, 0.194245,
                (
                    {'tabs': (GafferUI.NodeEditor( scriptNode ), GafferSceneUI.SceneHierarchy( scriptNode )), 'currentTab': 1},
                    {'tabs': (GafferUI.ScriptEditor( scriptNode ),), 'currentTab': 0}
                )
            )
        )
    )
)
""")

then the exception becomes:

NameError : line 26 : name 'GafferSceneUI' is not defined 

So it could just be that error being reported incorrectly?

davidsminor commented 9 years ago

Also, if I import GafferSceneUI beforehand, I can eval the offending string without any problems

johnhaddon commented 9 years ago

That sounds about right - the only times I've ever seen this "error return without exception set" message, there has been a genuine exception thrown somewhere - but it has been mysteriously turned into the confusing one instead. Like it says above though, I haven't managed to reproduce this using PySide, only PyQt.