Martin Panter added the comment: This looks good for Python 2 and the equivalent for Python 3.
FWIW the ValueError case is platform-dependent. On Linux, I see EINVAL (the IOError version of ValueError): >>> flock(0, LOCK_UN) >>> flock(0, 0) Traceback (most recent call last): File "<stdin>", line 1, in <module> IOError: [Errno 22] Invalid argument ---------- nosy: +martin.panter _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25605> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com