MCPcopy Index your code
hub / github.com/RustPython/RustPython / _force_run

Function _force_run

Lib/test/support/__init__.py:208–221  ·  view source on GitHub ↗
(path, func, *args)

Source from the content-addressed store, hash-verified

206
207
208def _force_run(path, func, *args):
209 try:
210 return func(*args)
211 except FileNotFoundError as err:
212 # chmod() won't fix a missing file.
213 if verbose >= 2:
214 print('%s: %s' % (err.__class__.__name__, err))
215 raise
216 except OSError as err:
217 if verbose >= 2:
218 print('%s: %s' % (err.__class__.__name__, err))
219 print('re-run %s%r' % (func.__name__, args))
220 os.chmod(path, stat.S_IRWXU)
221 return func(*args)
222
223
224# Check whether a gui is actually available

Callers 2

_rmtree_innerFunction · 0.90
_rmtreeFunction · 0.90

Calls 3

funcFunction · 0.50
printFunction · 0.50
chmodMethod · 0.45

Tested by

no test coverage detected