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

[tor-commits] [chutney/master] lint: Fix undefined names



commit 857c4705155182392620e5f62a8e09f9516e6507
Author: c <c@xxxxxxxxxxx>
Date:   Thu May 14 21:33:19 2020 +0000

    lint: Fix undefined names
    
    Running flake8 on lib/chutney/*.py caught a few typographical errors and
    oversights.
---
 lib/chutney/Templating.py | 2 +-
 lib/chutney/TorNet.py     | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/chutney/Templating.py b/lib/chutney/Templating.py
index 2a658ab..43eb636 100755
--- a/lib/chutney/Templating.py
+++ b/lib/chutney/Templating.py
@@ -107,7 +107,7 @@ class _DictWrapper(object):
         self._parent = parent
 
     def _getitem(self, key, my):
-        raise NotImplemented()
+        raise NotImplementedError()
 
     def __getitem__(self, key):
         return self.lookup(key, self)
diff --git a/lib/chutney/TorNet.py b/lib/chutney/TorNet.py
index b68b240..41390e6 100644
--- a/lib/chutney/TorNet.py
+++ b/lib/chutney/TorNet.py
@@ -67,7 +67,7 @@ def getenv_type(env_var, default, type_, type_name=None):
             type_name = str(type_)
         raise ValueError(("Invalid value for environment variable '{}': "
                           "expected {}, but got '{}'")
-                         .format(env_var, typename, strval))
+                         .format(env_var, type_name, strval))
 
 def getenv_int(env_var, default):
     """
@@ -1757,7 +1757,7 @@ class LocalNodeController(NodeController):
         node_status = self.getNodeDirInfoStatus()
         if node_status:
             status_code, _, _, _ = node_status
-            return status_code == LocalDirectoryController.SUCCESS_CODE
+            return status_code == LocalNodeController.SUCCESS_CODE
         else:
             # Clients don't publish descriptors, so they are always ok.
             # (But we shouldn't print a descriptor status for them.)
@@ -2020,7 +2020,7 @@ class Network(object):
     def _addRequirement(self, requirement):
         requirement = requirement.upper()
         if requirement not in KNOWN_REQUIREMENTS:
-            raise RuntimemeError(("Unrecognized requirement %r"%requirement))
+            raise RuntimeError(("Unrecognized requirement %r"%requirement))
         self._requirements.append(requirement)
 
     def move_aside_nodes_dir(self):



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