Skip to content

Add check for older / non-compliant X servers#148

Merged
vasily-v-ryabov merged 1 commit intopython-xlib:masterfrom
NMRbox:master
Oct 6, 2019
Merged

Add check for older / non-compliant X servers#148
vasily-v-ryabov merged 1 commit intopython-xlib:masterfrom
NMRbox:master

Conversation

@Gerardwx
Copy link
Contributor

The existing code library generates a fatal exception:

File "/usr/lib/python3/dist-packages/Xlib/display.py", line 127, in __init__
    mod.init(self, info)
  File "/usr/lib/python3/dist-packages/Xlib/ext/xinput.py", line 652, in init
    disp.ge_add_event_data(info.major_opcode, device_event, DeviceEventData)
  File "/usr/lib/python3/dist-packages/Xlib/display.py", line 227, in __getattr__
    raise AttributeError(attr)
AttributeError: ge_add_event_data

when connected to RealVNC's current xserver.
VNC(R) Server 6.4.1 (r40826) x64 (Mar 13 2019 16:27:00)
Copyright (C) 2002-2019 RealVNC Ltd.

This prevents the exception by testing for the presence of ge_add_event_data before calling it.

@vasily-v-ryabov vasily-v-ryabov merged commit 8ce8502 into python-xlib:master Oct 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants