Skip to content

Commit

Permalink
Merge pull request #3138 from Tyler887/patch-1
Browse files Browse the repository at this point in the history
Fix python scripts to work with Python 3
  • Loading branch information
arantius authored Apr 22, 2022
2 parents efd22a9 + 779ab8d commit 11e340b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions test/scripts/script-server-slow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3
"""Serve a user script, slowly.
Serve a `.user.js` over HTTP, but very slowly. The script will stream out
Expand All @@ -9,7 +9,7 @@

import time

from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from http.server import BaseHTTPRequestHandler, HTTPServer


USER_JS = """// ==UserScript==
Expand Down Expand Up @@ -53,6 +53,6 @@ def do_GET(self):
if len(argv) == 2:
port = int(argv[1])

print 'Starting httpd at http://localhost:%d/ ...' % port
print('Starting httpd at http://localhost:%d/ ...' % port)
httpd = HTTPServer(('', port), S)
httpd.serve_forever()
6 changes: 3 additions & 3 deletions test/scripts/script-server-update.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3
"""Serve updatable user scripts.
This server will start at version 1, then return a higher version number each
Expand All @@ -9,7 +9,7 @@
import collections
import re

from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from http.server import BaseHTTPRequestHandler, HTTPServer


USER_JS = """// ==UserScript==
Expand Down Expand Up @@ -55,6 +55,6 @@ def do_GET(self):
if len(argv) == 2:
port = int(argv[1])

print 'Starting httpd at http://localhost:%d/ ...' % port
print('Starting httpd at http://localhost:%d/ ...' % port)
httpd = HTTPServer(('', port), S)
httpd.serve_forever()

0 comments on commit 11e340b

Please sign in to comment.