summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_mailbox.py
diff options
context:
space:
mode:
authorXavier de Gaye <xdegaye@users.sourceforge.net>2016-12-12 08:55:57 (GMT)
committerXavier de Gaye <xdegaye@users.sourceforge.net>2016-12-12 08:55:57 (GMT)
commit452b3a6a3e9e4ca99d9c6caff367fce749a7ec58 (patch)
tree86c92d001866ca9e68099298f75b39d048a98176 /Lib/test/test_mailbox.py
parentb227227cb574a7bad6ed6d5cfc3ef23b10b1919f (diff)
downloadcpython-452b3a6a3e9e4ca99d9c6caff367fce749a7ec58.zip
cpython-452b3a6a3e9e4ca99d9c6caff367fce749a7ec58.tar.gz
cpython-452b3a6a3e9e4ca99d9c6caff367fce749a7ec58.tar.bz2
Issue #28764: Fix a test_mailbox failure on Android API 24 when run as a non-root user.
Diffstat (limited to 'Lib/test/test_mailbox.py')
-rw-r--r--Lib/test/test_mailbox.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py
index aeabdbb..2ba9443 100644
--- a/Lib/test/test_mailbox.py
+++ b/Lib/test/test_mailbox.py
@@ -2137,9 +2137,9 @@ class MaildirTestCase(unittest.TestCase):
if mbox:
fp.write(FROM_)
fp.write(DUMMY_MESSAGE)
- if hasattr(os, "link"):
+ try:
os.link(tmpname, newname)
- else:
+ except (AttributeError, PermissionError):
with open(newname, "w") as fp:
fp.write(DUMMY_MESSAGE)
self._msgfiles.append(newname)