In the Python module errno the constant errno.EDEADLOCK is missing. According to the Python documentation EDEADLOCK is part of the module.
The problem occurs when a process on a remote host runnning an OS as Linux returns EDEADLOCK. (I know EDEADLOCK is not Posix compatible and the Linux documentations says and it's synonym for EDEADLK, but Python allows to use it.)
I think a mapping from EDEADLOCK to EDEADLK would be sufficent to solve the problem.