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

[tor-commits] [stem/master] Drop http.client fallback



commit ab83d8ded24d83005834d4f0d1d9fd40bbd38e96
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Fri Jan 3 16:17:14 2020 -0800

    Drop http.client fallback
    
    Just a single normalization of HTTPMessage.
---
 test/unit/descriptor/remote.py | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/test/unit/descriptor/remote.py b/test/unit/descriptor/remote.py
index 98bb734b..d9893535 100644
--- a/test/unit/descriptor/remote.py
+++ b/test/unit/descriptor/remote.py
@@ -2,6 +2,7 @@
 Unit tests for stem.descriptor.remote.
 """
 
+import http.client
 import io
 import socket
 import time
@@ -18,11 +19,6 @@ from unittest.mock import patch, Mock, MagicMock
 from stem.descriptor.remote import Compression
 from test.unit.descriptor import read_resource
 
-try:
-  from http.client import HTTPMessage  # python3
-except ImportError:
-  from httplib import HTTPMessage  # python2
-
 TEST_RESOURCE = '/tor/server/fp/9695DFC35FFEB861329B9F1AB04C46397020CE31'
 
 # Output from requesting moria1's descriptor from itself...
@@ -94,7 +90,7 @@ def _dirport_mock(data, encoding = 'identity'):
   dirport_mock = Mock()
   dirport_mock().read.return_value = data
 
-  headers = HTTPMessage()
+  headers = http.client.HTTPMessage()
 
   for line in HEADER.splitlines():
     key, value = line.split(': ', 1)



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