diff options
author | Xavier de Gaye <xdegaye@users.sourceforge.net> | 2016-12-12 09:55:57 +0100 |
---|---|---|
committer | Xavier de Gaye <xdegaye@users.sourceforge.net> | 2016-12-12 09:55:57 +0100 |
commit | 7aa9589ed672656185eca3f8406438d6a2b7efb1 (patch) | |
tree | edbe8a1d8d0ecb4c1baef1eab9dc31a1df3dfce7 /Lib/test | |
parent | 69b110cdc19421d969c143187162f3387aa1a0a0 (diff) | |
download | cpython-7aa9589ed672656185eca3f8406438d6a2b7efb1.tar.gz |
Issue #28764: Fix a test_mailbox failure on Android API 24 when run as a non-root user.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_mailbox.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py index aeabdbb2b5..2ba944335a 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) |