From 2308740f64d4de603a7a818e718189e933625831 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Sun, 11 Dec 2016 14:48:32 -0800 Subject: Issue #28783: Replaces bdist_wininst in nuget packages with stub --- Tools/msi/distutils.command.__init__.py | 32 ---------------------------- Tools/msi/distutils.command.bdist_wininst.py | 20 +++++++++++++++++ Tools/msi/make_zip.py | 8 ++----- 3 files changed, 22 insertions(+), 38 deletions(-) delete mode 100644 Tools/msi/distutils.command.__init__.py create mode 100644 Tools/msi/distutils.command.bdist_wininst.py (limited to 'Tools') diff --git a/Tools/msi/distutils.command.__init__.py b/Tools/msi/distutils.command.__init__.py deleted file mode 100644 index 83f34b470a..0000000000 --- a/Tools/msi/distutils.command.__init__.py +++ /dev/null @@ -1,32 +0,0 @@ -"""distutils.command - -Package containing implementation of all the standard Distutils -commands.""" - -__all__ = ['build', - 'build_py', - 'build_ext', - 'build_clib', - 'build_scripts', - 'clean', - 'install', - 'install_lib', - 'install_headers', - 'install_scripts', - 'install_data', - 'sdist', - 'register', - 'bdist', - 'bdist_dumb', - 'bdist_rpm', - # This command is not included in this package - #'bdist_wininst', - 'check', - 'upload', - # These two are reserved for future use: - #'bdist_sdux', - #'bdist_pkgtool', - # Note: - # bdist_packager is not included because it only provides - # an abstract base class - ] diff --git a/Tools/msi/distutils.command.bdist_wininst.py b/Tools/msi/distutils.command.bdist_wininst.py new file mode 100644 index 0000000000..d586e34fec --- /dev/null +++ b/Tools/msi/distutils.command.bdist_wininst.py @@ -0,0 +1,20 @@ +"""distutils.command.bdist_wininst + +Suppresses the 'bdist_wininst' command, while still allowing +setuptools to import it without breaking.""" + +from distutils.core import Command +from distutils.errors import DistutilsPlatformError + +class bdist_wininst(Command): + description = "create an executable installer for MS Windows" + + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + raise DistutilsPlatformError("bdist_wininst is not supported " + "in this Python distribution") diff --git a/Tools/msi/make_zip.py b/Tools/msi/make_zip.py index 09f6fe328f..8dbe83e4f4 100644 --- a/Tools/msi/make_zip.py +++ b/Tools/msi/make_zip.py @@ -79,10 +79,6 @@ def include_in_lib(p): if name in EXCLUDE_FILE_FROM_LIBRARY: return False - # Special code is included below to patch this file back in - if [d.lower() for d in p.parts[-3:]] == ['distutils', 'command', '__init__.py']: - return False - suffix = p.suffix.lower() return suffix not in {'.pyc', '.pyo', '.exe'} @@ -218,8 +214,8 @@ def main(): extra_files = [] if s == 'Lib' and p == '**/*': extra_files.append(( - source / 'tools' / 'msi' / 'distutils.command.__init__.py', - Path('distutils') / 'command' / '__init__.py' + source / 'tools' / 'msi' / 'distutils.command.bdist_wininst.py', + Path('distutils') / 'command' / 'bdist_wininst.py' )) copied = copy_to_layout(temp / t.rstrip('/'), chain(files, extra_files)) print('Copied {} files'.format(copied)) -- cgit v1.2.1 From 610f5d739dd22bce352bde59dce3985c73aaefab Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 16 Dec 2016 10:00:39 +0100 Subject: python-gdb.py: catch gdb.error on gdb.selected_frame() --- Tools/gdb/libpython.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'Tools') diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py index 75f1ccbd44..ed515c0017 100755 --- a/Tools/gdb/libpython.py +++ b/Tools/gdb/libpython.py @@ -1527,7 +1527,11 @@ class Frame(object): def get_selected_python_frame(cls): '''Try to obtain the Frame for the python-related code in the selected frame, or None''' - frame = cls.get_selected_frame() + try: + frame = cls.get_selected_frame() + except gdb.error: + # No frame: Python didn't start yet + return None while frame: if frame.is_python_frame(): @@ -1668,6 +1672,10 @@ PyList() def move_in_stack(move_up): '''Move up or down the stack (for the py-up/py-down command)''' frame = Frame.get_selected_python_frame() + if not frame: + print('Unable to locate python frame') + return + while frame: if move_up: iter_frame = frame.older() @@ -1730,6 +1738,10 @@ class PyBacktraceFull(gdb.Command): def invoke(self, args, from_tty): frame = Frame.get_selected_python_frame() + if not frame: + print('Unable to locate python frame') + return + while frame: if frame.is_python_frame(): frame.print_summary() @@ -1747,8 +1759,12 @@ class PyBacktrace(gdb.Command): def invoke(self, args, from_tty): - sys.stdout.write('Traceback (most recent call first):\n') frame = Frame.get_selected_python_frame() + if not frame: + print('Unable to locate python frame') + return + + sys.stdout.write('Traceback (most recent call first):\n') while frame: if frame.is_python_frame(): frame.print_traceback() -- cgit v1.2.1