mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Update mailbox.py
This commit is contained in:
1 parent
9a40f9adec
commit
11a8655d0d
2 files changed
+2
-8
No files matched your search
Vendored
+1
-5
@@ -2183,11 +2183,7 @@ def _unlock_file(f):
|
||||
|
||||
def _create_carefully(path):
|
||||
"""Create a file if it doesn't exist and open for reading and writing."""
|
||||
fd = os.open(path, os.O_CREAT | os.O_EXCL | os.O_RDWR, 0o666)
|
||||
try:
|
||||
return open(path, 'rb+')
|
||||
finally:
|
||||
os.close(fd)
|
||||
return open(path, 'xb+')
|
||||
|
||||
def _create_temporary(path):
|
||||
"""Create a temp file based on path and open for reading and writing."""
|
||||
|
||||
Vendored
+1
-3
@@ -1,7 +1,6 @@
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import stat
|
||||
import socket
|
||||
import email
|
||||
import email.message
|
||||
@@ -13,7 +12,6 @@ from test.support import import_helper
|
||||
from test.support import os_helper
|
||||
from test.support import refleak_helper
|
||||
from test.support import socket_helper
|
||||
from test.support.testcase import ExtraAssertions
|
||||
import unittest
|
||||
import textwrap
|
||||
import mailbox
|
||||
@@ -1267,7 +1265,7 @@ class _TestMboxMMDF(_TestSingleFile):
|
||||
self._box.close()
|
||||
|
||||
|
||||
class TestMbox(_TestMboxMMDF, unittest.TestCase, ExtraAssertions):
|
||||
class TestMbox(_TestMboxMMDF, unittest.TestCase):
|
||||
|
||||
_factory = lambda self, path, factory=None: mailbox.mbox(path, factory)
|
||||
|
||||
|
||||
Reference in new issue
Block a user