[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [stem/master] Missing runner import for stem.connection



commit 8774d00808a33dc6265d994d05d61a8823d24c75
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Mon Apr 8 08:13:39 2013 -0700

    Missing runner import for stem.connection
    
    One thing I dislike about python imports is that they can sometimes happen
    transtively. If modoule A imports module B which imports module C then module A
    seems to have a reference to module C. This gets confusing as hell because when
    you see that the 'import B' is unused and remove it you get completely
    unrelated errors.
    
    Anywho, I got a slew of stacktraces while running the integ tests about a
    missing import for stem.connection in the runner module...
    
    ======================================================================
    ERROR: test_get_pid_by_port_netstat
    ----------------------------------------------------------------------
    Traceback:
      File "/home/atagar/Desktop/stem/test/integ/util/system.py", line 250, in test_get_pid_by_port_netstat
        elif not runner.is_ptraceable():
      File "/home/atagar/Desktop/stem/test/runner.py", line 415, in is_ptraceable
        tor_version = self.get_tor_version()
      File "/home/atagar/Desktop/stem/test/runner.py", line 569, in get_tor_version
        control_socket = self.get_tor_socket()
      File "/home/atagar/Desktop/stem/test/runner.py", line 536, in get_tor_socket
        stem.connection.authenticate(control_socket, CONTROL_PASSWORD, self.get_chroot())
    AttributeError: 'module' object has no attribute 'connection'
    
    I'm not really sure when this was introduced, but fixing it.
---
 test/runner.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/test/runner.py b/test/runner.py
index fb4a4cd..5010224 100644
--- a/test/runner.py
+++ b/test/runner.py
@@ -48,6 +48,7 @@ import tempfile
 import threading
 import time
 
+import stem.connection
 import stem.prereq
 import stem.process
 import stem.socket

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits