[tor-commits] [stem/master] 'async' SyntaxError with python 3.6 and above

atagar at torproject.org atagar at torproject.org
Wed Jul 11 16:11:30 UTC 2018


commit 6c677b6a4080d14a56d2d88ab2ddd9766cc60b9a
Author: Damian Johnson <atagar at torproject.org>
Date:   Wed Jul 11 09:05:32 2018 -0700

    '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/docs/change_log.rst b/docs/change_log.rst
index eeaf0362..88558374 100644
--- a/docs/change_log.rst
+++ b/docs/change_log.rst
@@ -80,6 +80,7 @@ The following are only available within Stem's `git repository
  * **Utilities**
 
   * Fixed PyPy compatibility (:trac:`26207`)
+  * Python 3.6+ syntax error if test_tools.py imported (:trac:`26739`)
   * Connection information from proc limited to 10,000 results
   * Accouting for attribute types in most equality checks and hashes
 
diff --git a/stem/util/test_tools.py b/stem/util/test_tools.py
index 722398d0..c7573202 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



More information about the tor-commits mailing list