Skip to content

waitFor... methods throw "TypeError: Callable argument is not a PyObjC closure". #164

Description

@amberneil

Pyatom is working well for me in most regards, but any methods that make use of the notification system throw the same error in Python 3.6.

Here's an example script. "app.activate()" successfully switches windows, but as soon as any "waitFor..." method is called, an error is thrown.

bundle = 'com.blackmagic-design.DaVinciResolve'
app = atomac.getAppRefByBundleId(bundle)
app.activate()
window = app.windows()[0]
app.waitForFocusedWindowToChange(window.AXTitle)

Results in:

Traceback (most recent call last):
  File "test.py", line 21, in <module>
    print(app.waitForFocusedWindowToChange(window.AXTitle))
  File "/Users/amberserver/miniconda3/envs/amber36/lib/python3.6/site-packages/atomac/AXClasses.py", line 1249, in waitForFocusedWindowToChange
    AXTitle=nextWinName)
  File "/Users/amberserver/miniconda3/envs/amber36/lib/python3.6/site-packages/atomac/AXClasses.py", line 1166, in waitFor
    return self._waitFor(timeout, notification, **kwargs)
  File "/Users/amberserver/miniconda3/envs/amber36/lib/python3.6/site-packages/atomac/AXClasses.py", line 626, in _waitFor
    callbackKwargs)
  File "/Users/amberserver/miniconda3/envs/amber36/lib/python3.6/site-packages/atomac/_a11y.py", line 129, in _setNotification
    err, observer = AXObserverCreate(pid, observerCallback, None)
TypeError: Callable argument is not a PyObjC closure

I'm on MacOS High Sierra 10.13.6, using Python 3.6 in a miniconda environment where Pyatom is installed with pip directly from GitHub through:

pip install git+https://github.com/pyatom/pyatom.git

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions