Skip to content

Commit

Permalink
Python 3 migrate SocketServer
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Apr 15, 2016
1 parent 3e300f2 commit 4af3f82
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/src/python/test_qgscomposerpicture.py
Expand Up @@ -15,7 +15,7 @@
import qgis # NOQA

import os
import SocketServer
import socketserver
import threading
import SimpleHTTPServer
from PyQt.QtCore import QRectF
Expand All @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions tests/src/python/test_qgsnetworkcontentfetcher.py
Expand Up @@ -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):
Expand All @@ -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)
Expand Down

0 comments on commit 4af3f82

Please sign in to comment.