chiark / gitweb /
ResponseConsumer: move _resp initialisation to superclass constructor (nfc)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 22 Aug 2017 16:32:00 +0000 (17:32 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 22 Aug 2017 16:32:00 +0000 (17:32 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
hippotat

index 8bcd62f89ec57fece063106c8a4d9238927fc791..abe1caeb88b891f92f4c925e51d0c4c41030b95a 100755 (executable)
--- a/hippotat
+++ b/hippotat
@@ -33,6 +33,7 @@ class GeneralResponseConsumer(twisted.internet.protocol.Protocol):
   def __init__(self, cl, req, resp, desc):
     self._cl = cl
     self._req = req
   def __init__(self, cl, req, resp, desc):
     self._cl = cl
     self._req = req
+    self._resp = resp
     self._desc = desc
 
   def _log(self, dflag, msg, **kwargs):
     self._desc = desc
 
   def _log(self, dflag, msg, **kwargs):
@@ -79,7 +80,6 @@ class ResponseConsumer(GeneralResponseConsumer):
 class ErrorResponseConsumer(GeneralResponseConsumer):
   def __init__(self, cl, req, resp):
     super().__init__(cl, req, resp, 'ERROR-RC')
 class ErrorResponseConsumer(GeneralResponseConsumer):
   def __init__(self, cl, req, resp):
     super().__init__(cl, req, resp, 'ERROR-RC')
-    self._resp = resp
     self._m = b''
     try:
       self._phrase = resp.phrase.decode('utf-8')
     self._m = b''
     try:
       self._phrase = resp.phrase.decode('utf-8')