Python Esc cancel does not work in rhino 6 osx

Trying to make a cancel-able python script on mac in rhino 6.
script:

import rhinoscriptsyntax as rs
import Rhino
def TimeConsumingTask():

    for i in range(10000):
        # Was escape key pressed?
        Rhino.RhinoApp.Wait()
        rs.Sleep(1)
        if (scriptcontext.escape_test(False)):
            print "TimeConsumingTask cancelled."
            break
        print i
TimeConsumingTask()

I found these commands to try and help escape_test be detected, but no luck.

Rhino.RhinoApp.Wait()
        rs.Sleep(1)

Anybody have a fix for this or should it be reported as a bug?
Cheers

Hi @tristanryerparke,

I am able to repeat this, and I have logged the issue.

https://mcneel.myjetbrains.com/youtrack/issue/RH-61506

– Dale