MCPcopy Index your code
hub / github.com/davispuh/MySQL-for-Python-3 / _no_sandbox

Function _no_sandbox

distribute_setup.py:208–230  ·  view source on GitHub ↗
(function)

Source from the content-addressed store, hash-verified

206
207
208def _no_sandbox(function):
209 def __no_sandbox(*args, **kw):
210 try:
211 from setuptools.sandbox import DirectorySandbox
212 if not hasattr(DirectorySandbox, '_old'):
213 def violation(*args):
214 pass
215 DirectorySandbox._old = DirectorySandbox._violation
216 DirectorySandbox._violation = violation
217 patched = True
218 else:
219 patched = False
220 except ImportError:
221 patched = False
222
223 try:
224 return function(*args, **kw)
225 finally:
226 if patched:
227 DirectorySandbox._violation = DirectorySandbox._old
228 del DirectorySandbox._old
229
230 return __no_sandbox
231
232
233def _patch_file(path, content):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected