From 4cf43aee00518e087ab98680ebea2e2e4d188c1b Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Feb 19 2016 20:40:27 +0000 Subject: Apply python35 compat patch for rawhide. --- diff --git a/python-cmd2-python35-compat.patch b/python-cmd2-python35-compat.patch new file mode 100644 index 0000000..631c863 --- /dev/null +++ b/python-cmd2-python35-compat.patch @@ -0,0 +1,25 @@ +--- a/cmd2.py ++++ b/cmd2.py +@@ -47,6 +47,13 @@ + if sys.version_info[0] == 2: + pyparsing.ParserElement.enablePackrat() + ++try: ++ is_mswindows = subprocess.mswindows ++except AttributeError: ++ # Python 3.5+ ++ is_mswindows = subprocess._mswindows ++ ++ + """ + Packrat is causing Python3 errors that I don't understand. + +@@ -184,7 +191,7 @@ + to be installed on operating system. + %s""" + +-if subprocess.mswindows: ++if is_mswindows: + try: + import win32clipboard + def get_paste_buffer(): diff --git a/python-cmd2.spec b/python-cmd2.spec index a8a4dd0..758d3fa 100644 --- a/python-cmd2.spec +++ b/python-cmd2.spec @@ -6,7 +6,7 @@ Name: python-cmd2 Version: 0.6.8 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Extra features for standard library's cmd module Group: Development/Libraries @@ -14,6 +14,9 @@ License: MIT URL: http://pypi.python.org/pypi/cmd2 Source0: http://pypi.python.org/packages/source/c/%{modname}/%{modname}-%{version}.tar.gz +# https://bitbucket.org/catherinedevlin/cmd2/issues/18 +Patch0: python-cmd2-python35-compat.patch + BuildArch: noarch @@ -86,6 +89,7 @@ See docs at http://packages.python.org/cmd2/ %prep %setup -q -n %{modname}-%{version} +%patch0 -p1 chmod -x README.txt dos2unix README.txt @@ -127,6 +131,9 @@ popd %endif %changelog +* Fri Feb 19 2016 Ralph Bean - 0.6.8-6 +- Apply patch for compat on python-3.5. + * Thu Feb 04 2016 Fedora Release Engineering - 0.6.8-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild