# Buggy code
def __buttonPress(self, widget, event):
    if not self._editable():
        return False

    # we only store a weak reference to the dialogue, because we want to allow it
    # to manage its own lifetime. this allows it to exist after we've died, which
    # can be useful for the user - they can bring up a node editor to get access to
    # the color chooser, and then close the node editor but keep the floating color
    # chooser. the only reason we keep a reference to the dialogue at all is so that
    # we can avoid opening two at the same time.
    if self.__colorChooserDialogue is None or self.__colorChooserDialogue() is None:
        self.__colorChooserDialogue = weakref.ref(
            _ColorPlugValueDialogue(self.getPlug(), self.ancestor(GafferUI.Window))
        )

    self.__colorChooserDialogue().setVisible(True)

    return True


# Traceback (RuntimeError)
# Traceback (most recent call last):
# File "/software/apps/gaffer/0.58.0/cent5.x86_64/cortex/8/maya/2012/python/GafferUI/Widget.py", line 1458, in eventFilter
# return self.__mouseMove( qObject, qEvent )
# File "/software/apps/gaffer/0.58.0/cent5.x86_64/cortex/8/maya/2012/python/GafferUI/Widget.py", line 1603, in __mouseMove
# return widget._mouseMoveSignal( widget, event )
# File "/software/apps/gaffer/0.58.0/cent5.x86_64/cortex/8/maya/2012/python/Gaffer/WeakMethod.py", line 57, in __call__
# return m( *args, **kwArgs )
# File "/software/apps/gaffer/0.58.0/cent5.x86_64/cortex/8/maya/2012/python/GafferUI/Slider.py", line 146, in __mouseMove
# self.setPosition( float( event.line.p0.x ) / self.size().x )
# File "/software/apps/gaffer/0.58.0/cent5.x86_64/cortex/8/maya/2012/python/GafferUI/NumericSlider.py", line 73, in setPosition
# self.setValue( self.__min + position * ( self.__max - self.__min ) )
# File "/software/apps/gaffer/0.58.0/cent5.x86_64/cortex/8/maya/2012/python/GafferUI/NumericSlider.py", line 90, in setValue
# signal( self )
# File "/software/apps/gaffer/0.58.0/cent5.x86_64/cortex/8/maya/2012/python/Gaffer/WeakMethod.py", line 57, in __call__
# return m( *args, **kwArgs )
# File "/software/apps/gaffer/0.58.0/cent5.x86_64/cortex/8/maya/2012/python/GafferUI/ColorChooser.py", line 203, in __sliderChanged
# self.setColor( newColor )
# File "/software/apps/gaffer/0.58.0/cent5.x86_64/cortex/8/maya/2012/python/GafferUI/ColorChooser.py", line 174, in setColor
# self.__colorChangedSignal( self )
# File "/software/apps/gaffer/0.58.0/cent5.x86_64/cortex/8/maya/2012/python/Gaffer/WeakMethod.py", line 57, in __call__
# return m( *args, **kwArgs )
# File "/software/apps/gaffer/0.58.0/cent5.x86_64/cortex/8/maya/2012/python/GafferUI/ColorPlugValueWidget.py", line 131, in __colorChanged
# self.__plug.setValue( self.colorChooser().getColor() )
# RuntimeError: Exception : Cannot set value for plug "ShaderGraphApp.scripts.ScriptNode.PublicParameters.ieSimpleSurface.parameters.diffuseTint.r" except during computation.

# Fixed code
def __buttonPress(self, widget, event):
    if not self._editable():
        if self.__blinkBehaviour is not None:
            self.__blinkBehaviour.stop()
        widgets = [w for w in self._row()[: len(self.getPlug())] if not w._editable()]
        self.__blinkBehaviour = _BlinkBehaviour(widgets)
        self.__blinkBehaviour.start()

        return False

    # we only store a weak reference to the dialogue, because we want to allow it
    # to manage its own lifetime. this allows it to exist after we've died, which
    # can be useful for the user - they can bring up a node editor to get access to
    # the color chooser, and then close the node editor but keep the floating color
    # chooser. the only reason we keep a reference to the dialogue at all is so that
    # we can avoid opening two at the same time.
    if self.__colorChooserDialogue is None or self.__colorChooserDialogue() is None:
        self.__colorChooserDialogue = weakref.ref(
            _ColorPlugValueDialogue(self.getPlug(), self.ancestor(GafferUI.Window))
        )

    self.__colorChooserDialogue().setVisible(True)

    return True