Issue #21 resolved

Python 2.4 compatibility

Jurko Gospodnetić
created an issue

setuptools/tests/test_easy_install.py module should not use the try/except/finally construct and should instead use a try/except block wrapped inside a separate try/finally block.

Without this we get ugly warnings/errors when installing setuptools on Python 3.2. This has been noticed when using the ez_setup.py bootstrap script called from another installation package, with setuptools version 0.7.2.

Current code:

        try:
            reset_setup_stop_context(
                lambda: run_setup(test_setup_py, ['install'])
            )
        except SandboxViolation:
            self.fail('Installation caused SandboxViolation')
        finally:
            sys.stdout = old_stdout
            sys.stderr = old_stderr

Corrected code (untested):

        try:
            try:
                reset_setup_stop_context(
                    lambda: run_setup(test_setup_py, ['install'])
                )
            except SandboxViolation:
                self.fail('Installation caused SandboxViolation')
        finally:
            sys.stdout = old_stdout
            sys.stderr = old_stderr

Comments (1)

  1. Log in to comment