Closed jessesuen closed 7 years ago
That's annoying.
Please change it to the following and test:
if getattr(_LIB, 'errno') is not None:
errno = _LIB.errno
elif getattr(_LIB, 'err') is not None:
errno = _LIB.err
else:
raise EnvironmentError("'errno' not found in library")
Thanks for contributing.
Updated with your feedback, although getattr() needs a default value or else it will still raise AttributeError.
Yep. This is just a more general solution, in the event that other distributions have that same difference.
You tested?
Yes, tested in debian:8.5 and alpine:3.4 containers.
Any chance we might see a release with this?
Accessing _LIB.errno on musl libc results in "AttributeError: Symbol not found: errno". For musl libc, changing this to _LIB.err resolves the issue.