Commit 292f0a6f authored by Jason R. Coombs's avatar Jason R. Coombs

Allow install to proceed with an egg install on IronPython and any other...

Allow install to proceed with an egg install on IronPython and any other environment that has no stack support. Fixes #177.
parent 359dcd42
......@@ -8,6 +8,10 @@ CHANGES
* Issue #176: Add parameter to the test command to support a custom test
runner: --test-runner or -r.
* Issue #177: Now assume most common invocation to install command on
platforms/environments without stack support (issuing a warning). Setuptools
now installs naturally on IronPython. Behavior on CPython should be
unchanged.
---
3.3
......
import setuptools
import inspect
import glob
import warnings
import platform
from distutils.command.install import install as _install
from distutils.errors import DistutilsArgError
......@@ -66,8 +68,16 @@ class install(_install):
'run_command' method in 'distutils.dist', and *its* caller will be
the 'run_commands' method. If called any other way, the
immediate caller *might* be 'run_command', but it won't have been
called by 'run_commands'. Return True in that case or False otherwise.
called by 'run_commands'. Return True in that case or if a call stack
is unavailable. Return False otherwise.
"""
if run_frame is None:
msg = "Call stack not available. bdist_* commands may fail."
warnings.warn(msg)
if platform.python_implementation() == 'IronPython':
msg = "For best results, pass -X:Frames to enable call stack."
warnings.warn(msg)
return True
res = inspect.getouterframes(run_frame)[2]
caller, = res[:1]
info = inspect.getframeinfo(caller)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment