def SafeWxCall(fcn):
    def wrapper(*args, **kwargs):
        "callafter wrapper"
        try:
            wx.CallAfter(fcn, *args, **kwargs)
        except PyDeadObjectError:
            pass
    wrapper.__doc__ = fcn.__doc__
    wrapper.__name__ = fcn.__name__
    wrapper.__dict__.update(fcn.__dict__)
    return wrapper
does the work for clearstamp() and clearstamps()
dataset/ETHPy150Open xraypy/xraylarch/plugins/wx/gui_utils.py/SafeWxCall--crossover with--dataset/ETHPy150Open amrdraz/kodr/app/brython/www/src/Lib/site-packages/turtle.py/RawTurtle._clearstamp