Skip to content
Permalink
Browse files

Python 3 migrate SocketServer

  • Loading branch information
m-kuhn committed Apr 15, 2016
1 parent 3e300f2 commit 4af3f82bd06e4890b1db46b099420b85d887194f
@@ -15,7 +15,7 @@
import qgis # NOQA

import os
import SocketServer
import socketserver
import threading
import SimpleHTTPServer
from PyQt.QtCore import QRectF
@@ -40,7 +40,7 @@ def setUpClass(cls):
os.chdir(unitTestDataPath() + '')
handler = SimpleHTTPServer.SimpleHTTPRequestHandler

cls.httpd = SocketServer.TCPServer(('localhost', 0), handler)
cls.httpd = socketserver.TCPServer(('localhost', 0), handler)
cls.port = cls.httpd.server_address[1]

cls.httpd_thread = threading.Thread(target=cls.httpd.serve_forever)
@@ -20,9 +20,9 @@
from utilities import unitTestDataPath
from PyQt.QtCore import QUrl, QCoreApplication
from PyQt.QtNetwork import QNetworkReply
import SocketServer
import socketserver
import threading
import SimpleHTTPServer
import http.server


class TestQgsNetworkContentFetcher(unittest.TestCase):
@@ -31,9 +31,9 @@ class TestQgsNetworkContentFetcher(unittest.TestCase):
def setUpClass(cls):
# Bring up a simple HTTP server
os.chdir(unitTestDataPath() + '')
handler = SimpleHTTPServer.SimpleHTTPRequestHandler
handler = http.server.SimpleHTTPRequestHandler

cls.httpd = SocketServer.TCPServer(('localhost', 0), handler)
cls.httpd = socketserver.TCPServer(('localhost', 0), handler)
cls.port = cls.httpd.server_address[1]

cls.httpd_thread = threading.Thread(target=cls.httpd.serve_forever)

0 comments on commit 4af3f82

Please sign in to comment.
You can’t perform that action at this time.