diff --git a/src/allmydata/client.py b/src/allmydata/client.py index 1eb72090f..1c5b68eb9 100644 --- a/src/allmydata/client.py +++ b/src/allmydata/client.py @@ -529,8 +529,6 @@ class _Client(node.Node, pollmixin.PollMixin): ps = self.config.get_config("client", "peers.preferred", "").split(",") preferred_peers = tuple([p.strip() for p in ps if p != ""]) - from allmydata.node import create_tub, create_tub_options - # this is temporary; create_client() should create a # storage-broker and pass it in -- that method already has # all these objects created... diff --git a/src/allmydata/introducer/server.py b/src/allmydata/introducer/server.py index 6b93a1841..c6fc81462 100644 --- a/src/allmydata/introducer/server.py +++ b/src/allmydata/introducer/server.py @@ -48,7 +48,6 @@ def create_introducer(basedir=u"."): ) # XXX fix up imports etc (also: reactor) - from twisted.internet import reactor from allmydata.node import create_i2p_provider, create_tor_provider i2p_provider = create_i2p_provider(reactor, basedir, config) tor_provider = create_tor_provider(reactor, basedir, config) diff --git a/src/allmydata/node.py b/src/allmydata/node.py index 426293506..86ca49772 100644 --- a/src/allmydata/node.py +++ b/src/allmydata/node.py @@ -12,7 +12,6 @@ import tempfile from io import BytesIO from base64 import b32decode, b32encode -from twisted.internet import reactor from twisted.python import log as twlog from twisted.application import service from twisted.python.failure import Failure diff --git a/src/allmydata/test/cli/test_daemonize.py b/src/allmydata/test/cli/test_daemonize.py index 2ec78c32c..c11331671 100644 --- a/src/allmydata/test/cli/test_daemonize.py +++ b/src/allmydata/test/cli/test_daemonize.py @@ -4,7 +4,6 @@ from mock import patch, Mock from StringIO import StringIO from sys import getfilesystemencoding from twisted.trial import unittest -from twisted.internet import defer from allmydata.scripts import runner from allmydata.scripts.tahoe_daemonize import identify_node_type from allmydata.scripts.tahoe_daemonize import DaemonizeTahoeNodePlugin diff --git a/src/allmydata/test/test_client.py b/src/allmydata/test/test_client.py index 44d93ca87..3c8d76662 100644 --- a/src/allmydata/test/test_client.py +++ b/src/allmydata/test/test_client.py @@ -222,7 +222,7 @@ class Basic(testutil.ReallyEqualMixin, testutil.NonASCIIPathMixin, unittest.Test "[storage]\n" + \ "enabled = true\n" + \ "reserved_space = bogus\n") - with self.assertRaises(ValueError) as ctx: + with self.assertRaises(ValueError): yield client.create_client(basedir) @defer.inlineCallbacks diff --git a/src/allmydata/test/test_connections.py b/src/allmydata/test/test_connections.py index ee0ccf65f..cafb6e3c1 100644 --- a/src/allmydata/test/test_connections.py +++ b/src/allmydata/test/test_connections.py @@ -8,7 +8,6 @@ from ..node import Node, PrivacyError, config_from_string from ..node import create_connection_handlers from ..node import create_i2p_provider, create_tor_provider from ..node import create_main_tub, _tub_portlocation -from ..client import create_client_from_config from ..util import connection_status @@ -161,7 +160,7 @@ class Tor(unittest.TestCase): ) with self.assertRaises(ValueError) as ctx: tor_provider = create_tor_provider(reactor, 'BASEDIR', config) - h = tor_provider.get_tor_handler() + tor_provider.get_tor_handler() self.assertIn( "Unknown endpoint type: 'meow'", str(ctx.exception) @@ -175,7 +174,7 @@ class Tor(unittest.TestCase): ) with self.assertRaises(ValueError) as ctx: tor_provider = create_tor_provider(reactor, 'BASEDIR', config) - h = tor_provider.get_tor_handler() + tor_provider.get_tor_handler() self.assertIn( "invalid literal for int() with base 10: 'kumquat'", str(ctx.exception) @@ -257,7 +256,7 @@ class I2P(unittest.TestCase): ) with self.assertRaises(ValueError) as ctx: i2p_provider = create_i2p_provider(reactor, 'BASEDIR', config) - h = i2p_provider.get_i2p_handler() + i2p_provider.get_i2p_handler() self.assertIn( "must not set both sam.port and launch", str(ctx.exception) diff --git a/src/allmydata/test/test_node.py b/src/allmydata/test/test_node.py index 32042fa03..a58e2ce66 100644 --- a/src/allmydata/test/test_node.py +++ b/src/allmydata/test/test_node.py @@ -15,9 +15,8 @@ from foolscap.api import flushEventualQueue import foolscap.logging.log from twisted.application import service -from allmydata.node import Node, formatTimeTahoeStyle, MissingConfigEntry, read_config, config_from_string, create_node_dir -from allmydata.node import create_tub from allmydata.node import create_tub_options +from allmydata.node import create_tub from allmydata.node import create_main_tub from allmydata.node import create_connection_handlers from allmydata.introducer.server import create_introducer diff --git a/src/allmydata/test/test_system.py b/src/allmydata/test/test_system.py index f46f9e104..cf77dd93c 100644 --- a/src/allmydata/test/test_system.py +++ b/src/allmydata/test/test_system.py @@ -784,7 +784,7 @@ class SystemTestMixin(pollmixin.PollMixin, testutil.StallMixin): c.setServiceParent(self.sparent) else: c.startService() - res = yield self.wait_for_connections() + yield self.wait_for_connections() defer.returnValue(c) def _check_connections(self):