Dolda2000 GitWeb
/
ashd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
python: Initial porting of the Python code to Python 3.
[ashd.git]
/
python
/
scgi-wsgi
diff --git
a/python/scgi-wsgi
b/python/scgi-wsgi
index
944ed39
..
9befb25
100755
(executable)
--- a/
python/scgi-wsgi
+++ b/
python/scgi-wsgi
@@
-1,4
+1,4
@@
-#!/usr/bin/python
+#!/usr/bin/python
3
import sys, os, getopt
import socket
import sys, os, getopt
import socket
@@
-15,12
+15,12
@@
for o, a in opts:
usage(sys.stdout)
sys.exit(0)
elif o == "-p":
usage(sys.stdout)
sys.exit(0)
elif o == "-p":
- sys.path.
append
(0, a)
+ sys.path.
insert
(0, a)
elif o == "-T":
sk = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
p = a.rfind(":")
if p < 0:
elif o == "-T":
sk = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
p = a.rfind(":")
if p < 0:
- bindhost = "
hostname
"
+ bindhost = "
localhost
"
bindport = int(a)
else:
bindhost = a[:p]
bindport = int(a)
else:
bindhost = a[:p]
@@
-41,14
+41,14
@@
if sk is None:
try:
handlermod = __import__(args[0], fromlist = ["dummy"])
try:
handlermod = __import__(args[0], fromlist = ["dummy"])
-except ImportError
,
exc:
- sys.stderr.write("scgi-wsgi: handler %s not found: %s\n" % (args[0], exc.
message
))
+except ImportError
as
exc:
+ sys.stderr.write("scgi-wsgi: handler %s not found: %s\n" % (args[0], exc.
args[0]
))
sys.exit(1)
if not modwsgi_compat:
if not hasattr(handlermod, "wmain"):
sys.stderr.write("scgi-wsgi: handler %s has no `wmain' function\n" % args[0])
sys.exit(1)
sys.exit(1)
if not modwsgi_compat:
if not hasattr(handlermod, "wmain"):
sys.stderr.write("scgi-wsgi: handler %s has no `wmain' function\n" % args[0])
sys.exit(1)
- handler = handlermod.wmain(args[1:])
+ handler = handlermod.wmain(
*
args[1:])
else:
if not hasattr(handlermod, "application"):
sys.stderr.write("scgi-wsgi: handler %s has no `application' object\n" % args[0])
else:
if not hasattr(handlermod, "application"):
sys.stderr.write("scgi-wsgi: handler %s has no `application' object\n" % args[0])