diff --git a/backport-Fix-Nonetype-error-when-building-with-PyInstaller-and-no-console-flag-2.4.3.patch b/backport-Fix-Nonetype-error-when-building-with-PyInstaller-and-no-console-flag-2.4.3.patch new file mode 100644 index 0000000000000000000000000000000000000000..b3abc27b773d41c5e82c60756615a3e5c68329ad --- /dev/null +++ b/backport-Fix-Nonetype-error-when-building-with-PyInstaller-and-no-console-flag-2.4.3.patch @@ -0,0 +1,26 @@ +From 3fc9b259d19f825b29fa72f0522bee1666a916a8 Mon Sep 17 00:00:00 2001 +From: zengliwen +Date: Tue, 11 Jun 2024 14:52:45 +0800 +Subject: [PATCH] [BugFix] Fix Nonetype error when building with PyInstaller + and no-console flag + +--- + cmd2/rl_utils.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cmd2/rl_utils.py b/cmd2/rl_utils.py +index e9557f0..0d19635 100644 +--- a/cmd2/rl_utils.py ++++ b/cmd2/rl_utils.py +@@ -70,7 +70,7 @@ if 'pyreadline3' in sys.modules: + ) + + # Check if we are running in a terminal +- if sys.stdout.isatty(): # pragma: no cover ++ if sys.stdout is not None and sys.stdout.isatty(): # pragma: no cover + # noinspection PyPep8Naming,PyUnresolvedReferences + def enable_win_vt100(handle: HANDLE) -> bool: + """ +-- +2.23.0 + diff --git a/python-cmd2.spec b/python-cmd2.spec index bb14d4404dd8088908b569e971f5df4de9ba946d..61d934db884d6aabc6d948e653622e8912d93185 100644 --- a/python-cmd2.spec +++ b/python-cmd2.spec @@ -1,11 +1,12 @@ %global _empty_manifest_terminate_build 0 Name: python-cmd2 Version: 2.4.3 -Release: 1 +Release: 2 Summary: cmd2 - quickly build feature-rich and user-friendly interactive command line applications in Python License: MIT URL: https://github.com/python-cmd2/cmd2 Source0: https://files.pythonhosted.org/packages/13/04/b85213575a7bf31cbf1d699cc7d5500d8ca8e52cbd1f3569a753a5376d5c/cmd2-2.4.3.tar.gz +Patch0: backport-Fix-Nonetype-error-when-building-with-PyInstaller-and-no-console-flag-2.4.3.patch BuildArch: noarch %description @@ -35,7 +36,7 @@ Provides: python3-cmd2-doc quickly build feature-rich and user-friendly interactive command line applications in Python %prep -%autosetup -n cmd2-%{version} +%autosetup -p1 -n cmd2-%{version} %build %py3_build @@ -78,6 +79,9 @@ mv %{buildroot}/doclist.lst . %{_docdir}/* %changelog +* Tue Jun 11 2024 zeng liwen - 2.4.3-2 +- Backport patch:Fix Nonetype error when building with PyInstaller and no-console flag + * Tue Mar 07 2023 wangjunqi - 2.4.3-1 - Update package to version 2.4.3