]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix test_access_denied in 3.5
authorBerker Peksag <berker.peksag@gmail.com>
Sat, 17 Sep 2016 13:20:55 +0000 (16:20 +0300)
committerBerker Peksag <berker.peksag@gmail.com>
Sat, 17 Sep 2016 13:20:55 +0000 (16:20 +0300)
Lib/test/test_os.py

index 9189a82dea595fd85347a24b4153607df5850835..44c65bf64a9c77f0be48d7ce58b2c76499e6bef6 100644 (file)
@@ -440,7 +440,8 @@ class StatAttributeTests(unittest.TestCase):
         # supports file ACLs.
         fname = os.path.join(os.environ['TEMP'], self.fname)
         self.addCleanup(support.unlink, fname)
-        create_file(fname, b'ABC')
+        with open(fname, 'xb', 0) as fp:
+            fp.write(b'ABC')
         # Deny the right to [S]YNCHRONIZE on the file to
         # force CreateFile to fail with ERROR_ACCESS_DENIED.
         DETACHED_PROCESS = 8