mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-26 00:02:08 -05:00
Python 3 migrate SocketServer
This commit is contained in:
parent
3e300f2966
commit
4af3f82bd0
@ -15,7 +15,7 @@ __revision__ = '$Format:%H$'
|
||||
import qgis # NOQA
|
||||
|
||||
import os
|
||||
import SocketServer
|
||||
import socketserver
|
||||
import threading
|
||||
import SimpleHTTPServer
|
||||
from PyQt.QtCore import QRectF
|
||||
@ -40,7 +40,7 @@ class TestQgsComposerPicture(unittest.TestCase):
|
||||
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 qgis.core import QgsNetworkContentFetcher
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user