From 7bbfdb5e72f2ea8205b45036a9797af4e83a26b2 Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Jul 17 2018 20:41:36 +0000 Subject: make it build on python 3.7 --- diff --git a/python-3.7-6c677b6a4080d14a56d2d88ab2ddd9766cc60b9a.patch b/python-3.7-6c677b6a4080d14a56d2d88ab2ddd9766cc60b9a.patch new file mode 100644 index 0000000..a623086 --- /dev/null +++ b/python-3.7-6c677b6a4080d14a56d2d88ab2ddd9766cc60b9a.patch @@ -0,0 +1,40 @@ +From 6c677b6a4080d14a56d2d88ab2ddd9766cc60b9a Mon Sep 17 00:00:00 2001 +From: Damian Johnson +Date: Wed, 11 Jul 2018 09:05:32 -0700 +Subject: 'async' SyntaxError with python 3.6 and above + +Python 3.6 adds a couple new keywords to the language (async and await) so we +need to be careful not to use those. 99.9% of our users don't import our test +utils so this was mostly moot, but Juan ran into an issue packaging Stem for +Fedora... + + BUILDSTDERR: File "/usr/lib/python3.7/site-packages/stem/util/test_tools.py", line 151 + BUILDSTDERR: self.method.async = self + BUILDSTDERR: ^ + BUILDSTDERR: SyntaxError: invalid syntax + + https://trac.torproject.org/projects/tor/ticket/26739 + +This line aimed to provide a way for tests to reference its AsyncTest instance. +This doesn't look to actually be used in practice so think we can simply drop +it. Checked with grep and a 'run_tests.py --all --target ONLINE' run. +--- + docs/change_log.rst | 1 + + stem/util/test_tools.py | 1 - + 2 files changed, 1 insertion(+), 1 deletion(-) + +diff --git a/stem/util/test_tools.py b/stem/util/test_tools.py +index 722398d..c757320 100644 +--- a/stem/util/test_tools.py ++++ b/stem/util/test_tools.py +@@ -148,7 +148,6 @@ class AsyncTest(object): + self._threaded = threaded + + self.method = lambda test: self.result(test) # method that can be mixed into TestCases +- self.method.async = self + + self._process = None + self._process_pipe = None +-- +cgit v1.1 + diff --git a/python-stem.spec b/python-stem.spec index a3f3758..73973f7 100644 --- a/python-stem.spec +++ b/python-stem.spec @@ -9,7 +9,7 @@ directory and control specifications. Name: python-stem Version: 1.6.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Python controller library for Tor # All source code is LGPLv3 except stem/util/ordereddict.py which is MIT License: LGPLv3 and MIT @@ -17,6 +17,8 @@ URL: https://stem.torproject.org/ Source0: https://files.pythonhosted.org/packages/source/s/%{srcname}/%{srcname}-%{version}.tar.gz # https://www.torproject.org/docs/signing-keys.html.en Source1: https://files.pythonhosted.org/packages/source/s/%{srcname}/%{srcname}-%{version}.tar.gz.asc +# adapted from https://gitweb.torproject.org/stem.git/patch/?id=6c677b6a4080d14a56d2d88ab2ddd9766cc60b9a +Patch0: python-3.7-6c677b6a4080d14a56d2d88ab2ddd9766cc60b9a.patch BuildArch: noarch BuildRequires: python2-devel @@ -56,7 +58,7 @@ Summary: %{summary} %description doc %_description %prep -%autosetup -n %{srcname}-%{version} +%autosetup -p1 -n %{srcname}-%{version} %build %py2_build @@ -96,6 +98,9 @@ install -D -m 0644 docs/_build/man/%{srcname}.1 %{buildroot}%{_mandir}/man1/%{sr %{_mandir}/man1/%{srcname}.1* %changelog +* Tue Jul 17 2018 mh - 1.6.0-5 +- Make it build on python 3.7 + * Sat Jul 14 2018 Fedora Release Engineering - 1.6.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild