ID 230956 - "A PythonObject is not attached to a node" dependencies error after expression-linked node replaced and deleted.

Follow

Problem summary

"A PythonObject is not attached to a node" dependencies error after expression-linked node replaced and deleted.

Customer reported version

NukeX9.0v7 & NukeX 10.0v4.000018b

Customer reported platform

centos6

Steps to reproduce

1.
open Nuke

2.
drag [attachment] 
ghostDependencyError.nk 
into the node graph, leaving it selected

3.
paste [attachment] 
expressionLinkCacheError_delete_NoOp1.py 
into the Script Editor and run it

Workaround

not ideal, but
if you run it once without deleting NoOp1
(i.e. comment-out the statement, 
nuke.delete(noop1)
then it correctly returns 2 dependencies

# Result: Group1.Input1
Group1.NoOp1

then run it again deleting NoOp1, it works,
correctly returning the only dependency

# Result: Group1.Input1


Reproduced by support

repro'd on OS 10.10.5 in

10.0v3
9.0v7
9.0v1
8.0v1
7.0v1
(didn't test earlier versions)

Expected behaviour

# Result: Group1.Input1

Actual behaviour

# Result: Group1.Input1
Traceback (most recent call last):
File "<string>", line 37, in <module>
File "<string>", line 34, in switchNoOps
ValueError: A PythonObject is not attached to a node

    We're sorry to hear that

    Please tell us why