diff --git a/PyInstaller/loader/pyimod03_importers.py b/PyInstaller/loader/pyimod03_importers.py index 948bd9c780..40931371f8 100644 --- a/PyInstaller/loader/pyimod03_importers.py +++ b/PyInstaller/loader/pyimod03_importers.py @@ -33,7 +33,7 @@ # with using type() function: imp_new_module = type(sys) -if sys.flags.verbose: +if sys.flags.verbose and sys.stderr: def trace(msg, *a): sys.stderr.write(msg % a) sys.stderr.write("\n") diff --git a/news/4213.bugfix.rst b/news/4213.bugfix.rst new file mode 100644 index 0000000000..14a101416c --- /dev/null +++ b/news/4213.bugfix.rst @@ -0,0 +1,4 @@ +(Windows) Fix the frozen program crashing immediately with +``Failed to execute script pyiboot01_bootstrap`` message when built in +``noconsole`` mode and with import logging enabled (either via +``--debug imports`` or ``--debug all`` command-line switch).