We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5143e74 commit fc1f92dCopy full SHA for fc1f92d
Lib/test/test_linecache.py
@@ -199,15 +199,16 @@ def raise_oserror(*args, **kwargs):
199
200
def test_updatecache_oserror(self):
201
linecache.clearcache()
202
- def raise_oserror(*args, **kwargs):
203
- raise OSError
204
source_name = os_helper.TESTFN
205
self.addCleanup(os_helper.unlink, os_helper.TESTFN)
+
+ def raise_oserror(*args, **kwargs):
206
+ raise OSError
207
with open(source_name, 'w', encoding='utf-8') as source:
208
source.write(SOURCE_4)
209
_ = linecache.getlines(source_name)
210
self.assertEqual(1, len(linecache.cache.keys()))
-
211
212
with support.swap_attr(os, 'stat', raise_oserror):
213
# Trace OSError with no pop cache
214
_ = linecache.updatecache('dummy')
0 commit comments