]> granicus.if.org Git - python/commitdiff
According to the man pages on Gentoo Linux and Tru64, EACCES or EAGAIN
authorNeal Norwitz <nnorwitz@gmail.com>
Wed, 28 Jun 2006 05:03:22 +0000 (05:03 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Wed, 28 Jun 2006 05:03:22 +0000 (05:03 +0000)
can be returned if fcntl (lockf) fails.  This fixes the test failure
on Tru64 by checking for either error rather than just EAGAIN.

Lib/mailbox.py

index 02fbb854c60eac9b2a17026877ff83d2295f2681..d054628c7a869a58193d9fa155d18836a1f5062b 100755 (executable)
@@ -1805,7 +1805,7 @@ def _lock_file(f, dotlock=True):
             try:
                 fcntl.lockf(f, fcntl.LOCK_EX | fcntl.LOCK_NB)
             except IOError, e:
-                if e.errno == errno.EAGAIN:
+                if e.errno in (errno.EAGAIN, errno.EACCES):
                     raise ExternalClashError('lockf: lock unavailable: %s' %
                                              f.name)
                 else: