From 0b96124b69b8e9b0440edf337e9123b2da67c194 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Sun, 7 May 2023 08:48:30 -0600 Subject: pdb: minor tweaks to doc [skip appveyor] Explanations of new "recognize sconscripts" behavior to debugger support are tweaked a bit to hopefully be more clear. Signed-off-by: Mats Wichmann --- CHANGES.txt | 5 +++-- RELEASE.txt | 6 ++++-- SCons/Script/Main.py | 11 +++++++---- doc/man/scons.xml | 14 +++++++------- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 58a3840..60f5f96 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -24,8 +24,9 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - Python 3.9 dropped the alias base64.decodestring, deprecated since 3.1. Only used in msvs.py. Use base64.decodebytes instead. - When debugging (--debug=pdb), the filenames SConstruct and SConscript - are now recognized when manipulating breakpoints. Previously, only a - full pathname worked, as otherwise pdb required a .py extension on files. + are now recognized when manipulating breakpoints. Previously, + only a full pathname to an sconscript file worked, as pdb requires + a .py extension to open a file that is not an absolute path. RELEASE 4.5.2 - Sun, 21 Mar 2023 14:08:29 -0700 diff --git a/RELEASE.txt b/RELEASE.txt index c2244f2..0d931b7 100644 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -26,8 +26,10 @@ DEPRECATED FUNCTIONALITY CHANGED/ENHANCED EXISTING FUNCTIONALITY --------------------------------------- -- List modifications to existing features, where the previous behavior - wouldn't actually be considered a bug +- When debugging (--debug=pdb), the filenames SConstruct and SConscript + are now recognized when manipulating breakpoints. Previously, + only a full pathname to an sconscript file worked, as pdb requires + a .py extension to open a file that is not an absolute path. FIXES ----- diff --git a/SCons/Script/Main.py b/SCons/Script/Main.py index ab4eedf..79806ba 100644 --- a/SCons/Script/Main.py +++ b/SCons/Script/Main.py @@ -1397,10 +1397,13 @@ def _exec_main(parser, values) -> None: def lookupmodule(self, filename: str) -> Optional[str]: """Helper function for break/clear parsing -- SCons version. - Copy of the original, but recognizes common names for - SConstruct/SConscript without having to have them end in ``.py`` + translates (possibly incomplete) file or module name + into an absolute file name. - .. versionadded:: 4.5.0 + The SCons override recognizes common names for ``SConstruct`` + and ``SConscript`` without requiring a ``.py`` suffix. + + .. versionadded:: 4.6.0 """ if os.path.isabs(filename) and os.path.exists(filename): return filename @@ -1412,7 +1415,7 @@ def _exec_main(parser, values) -> None: "SConstruct Sconstruct sconstruct SConscript sconscript".split() ) base = os.path.split(filename)[-1] - if ext == '' and base not in SCONSCRIPTS: + if ext == '' and base not in SCONSCRIPTS: # SCons filename = filename + '.py' if os.path.isabs(filename): return filename diff --git a/doc/man/scons.xml b/doc/man/scons.xml index a6294ac..97a6131 100644 --- a/doc/man/scons.xml +++ b/doc/man/scons.xml @@ -973,8 +973,8 @@ $ scons --debug=pdb beginning of the &scons; main routine on startup. The search path (sys.path) at that point will include the location of the running &scons;, -but not of the project itself - -if you need to set breakpoints in your project files, +but not of the project itself. +If you need to set breakpoints in your project files, you will either need to add to the path, or use absolute pathnames when referring to project files. A .pdbrc file in the project root @@ -992,17 +992,17 @@ the break, tbreak and clear commands only understand references to filenames -which end in a .py suffix -(although that suffix does not have to be typed), +which have a .py extension. +(although the suffix itself can be omitted), except if you use an absolute path. As a special exception to that rule, the names &SConstruct; and &SConscript; are recognized without needing the .py extension. -Changed in version 4.5.0: +Changed in version 4.6.0: The names &SConstruct; and &SConscript; are now -recognized without needing to have a +recognized without requiring .py suffix. @@ -4005,7 +4005,7 @@ it will not be added again. The default is False. library can be a list of library names, or None (the default if the argument is omitted). If the former, symbol is checked against -each library name in order, returning +each library name in order, returning (and reporting success) on the first successful test; if the latter, it is checked with the current value of &cv-LIBS; -- cgit v0.12