[pkg] Drop SandboxViolation verification cracking
authorDenis Laxalde <denis.laxalde@logilab.fr>
Wed, 24 Jan 2018 11:51:23 +0100
changeset 12256 af1245fe6b7b
parent 12255 08628d6d57ee
child 12257 39cd3c7eb2e8
[pkg] Drop SandboxViolation verification cracking Dunno what this is for. Let's see if this work without.
setup.py
--- a/setup.py	Wed Jan 24 11:43:13 2018 +0100
+++ b/setup.py	Wed Jan 24 11:51:23 2018 +0100
@@ -23,7 +23,6 @@
 
 import io
 import os
-import sys
 from os.path import dirname, exists, isdir, join
 
 from setuptools import setup
@@ -70,24 +69,6 @@
     return result
 
 
-try:
-    import setuptools.command.easy_install # only if easy_install available
-    # monkey patch: Crack SandboxViolation verification
-    from setuptools.sandbox import DirectorySandbox as DS
-    old_ok = DS._ok
-    def _ok(self, path):
-        """Return True if ``path`` can be written during installation."""
-        out = old_ok(self, path) # here for side effect from setuptools
-        realpath = os.path.normcase(os.path.realpath(path))
-        allowed_path = os.path.normcase(sys.prefix)
-        if realpath.startswith(allowed_path):
-            out = True
-        return out
-    DS._ok = _ok
-except ImportError:
-    pass
-
-
 setup(
     name=distname,
     version=version,