aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests/test_sandbox.py
diff options
context:
space:
mode:
Diffstat (limited to 'setuptools/tests/test_sandbox.py')
-rw-r--r--setuptools/tests/test_sandbox.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/setuptools/tests/test_sandbox.py b/setuptools/tests/test_sandbox.py
index 3dad1376..6a890ebc 100644
--- a/setuptools/tests/test_sandbox.py
+++ b/setuptools/tests/test_sandbox.py
@@ -19,7 +19,7 @@ def has_win32com():
if not sys.platform.startswith('win32'):
return False
try:
- mod = __import__('win32com')
+ __import__('win32com')
except ImportError:
return False
return True
@@ -33,8 +33,6 @@ class TestSandbox(unittest.TestCase):
shutil.rmtree(self.dir)
def test_devnull(self):
- if sys.version < '2.4':
- return
sandbox = DirectorySandbox(self.dir)
sandbox.run(self._file_writer(os.devnull))
@@ -72,8 +70,14 @@ class TestSandbox(unittest.TestCase):
target = pkg_resources.resource_filename(__name__,
'script-with-bom.py')
namespace = types.ModuleType('namespace')
- setuptools.sandbox.execfile(target, vars(namespace))
+ setuptools.sandbox._execfile(target, vars(namespace))
assert namespace.result == 'passed'
+ def test_setup_py_with_CRLF(self):
+ setup_py = os.path.join(self.dir, 'setup.py')
+ with open(setup_py, 'wb') as stream:
+ stream.write(b'"degenerate script"\r\n')
+ setuptools.sandbox._execfile(setup_py, globals())
+
if __name__ == '__main__':
unittest.main()