Subst should not stringify a callable if it didn't match the arguments
Mathew Robinson <[email protected]>
| Newsgroups | gmane.comp.programming.tools.scons.user |
|---|---|
| Message-ID | <CAFvD1Y7Bpy7rsn_4G5K7j7MJbFpHieojsS8oAE68kVm04r95UA@mail.gmail.com> |
I was going to file a bug but then saw I should post this here first to confirm. In this branch: https://github.com/SCons/scons/blob/master/src/engine/SCons/Subst.py#L712 during substitution if the callable throws a TypeError and the ListSubber (or StringSubber it has the same logic) is not in SUBST_RAW mode it assumes that it should convert it to a string. This causes hard to debug errors as a user if my callable throws a TypeError. As an example when MongoDB was going through our Python 3 upgrade we had a variant dir generator for the subst '$BUILD_DIR' generate the following: "build/<function default_variant_dir_generator at 0x103f17840>/mongo/base/error_codes.h" If a TypeError occurs in a callable and mode != SUBST_RAW I would expect scons to error and report this to me. If there is some use case where it should continue then I would expect scons to inspect the TypeError to make sure it's an argument failure (I could find no way to do this by reading the python language docs other than error message string inspection). Happy to file a bug if this is the recommended course. -- -- Mathew Robinson (chasinglogic) _______________________________________________ Scons-users mailing list [email protected] https://pairlist4.pair.net/mailman/listinfo/scons-users