Skip to content

Commit 9dacd3d

Browse files
authored
Use builtins.open for file operations in tests
1 parent 39e6187 commit 9dacd3d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/idlelib/idle_test/test_iomenu.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from idlelib import iomenu
44
import unittest
5+
import builtins
56
from test.support import requires
67
from tkinter import Tk
78
from idlelib.editor import EditorWindow
@@ -101,7 +102,7 @@ def test_reload_with_file(self):
101102
self.assertEqual(text.get('1.0', 'end-1c'), "# Original content\n")
102103

103104
# Modify the file content externally
104-
with open(temp_filename, 'w') as f:
105+
with builtins.open(temp_filename, 'w') as f:
105106
f.write("# Modified content\n")
106107

107108
# Reload should update the content

0 commit comments

Comments
 (0)