Commit 500e0a8c authored by Denis Bilenko's avatar Denis Bilenko

use "print (xxx)" instead of print xxx for compatibility with py3k. Patch by Damien Churchill.

parent 1f9a1f06
......@@ -100,6 +100,6 @@ class _fileobject(socket._fileobject):
if __name__ == '__main__':
if not sys.argv[1:]:
print 'USAGE: %s PORT' % sys.argv[0]
print ('USAGE: %s PORT' % sys.argv[0])
else:
BackdoorServer(('127.0.0.1', int(sys.argv[1]))).serve_forever()
......@@ -105,7 +105,7 @@ class HTTPResponse(object):
if self.debuglevel > 0:
for (k, v) in self.getheaders():
print 'header:', k, v
print ('header: %s %s' % (k, v))
def read(self, amt=-1):
return self._request.input_buffer.read(amt)
......@@ -199,7 +199,7 @@ class HTTPConnection(object):
if self.conn: return
if self.debuglevel > 0:
print 'connect: (%s, %u)' % (self.host, self.port)
print ('connect: (%s, %u)' % (self.host, self.port))
self.conn = core.http_connection.new(self.host, self.port, get_hub().reactor)
......@@ -234,6 +234,6 @@ class HTTPConnection(object):
def send(self, data):
if self.debuglevel > 0:
print 'send:', repr(data)
print ('send: %r' % data)
self.req.output_buffer.write(data)
......@@ -230,11 +230,11 @@ MONKEY OPTIONS: --verbose %s""" % ', '.join('--[no-]%s' % m for m in modules)
if verbose:
import pprint
import os
print 'gevent.monkey.patch_all(%s)' % ', '.join('%s=%s' % item for item in args.items())
print 'sys.version=%s' % (sys.version.strip().replace('\n', ' '), )
print 'sys.path=%s' % pprint.pformat(sys.path)
print 'sys.modules=%s' % pprint.pformat(sorted(sys.modules.keys()))
print 'cwd=%s' % os.getcwd()
print ('gevent.monkey.patch_all(%s)' % ', '.join('%s=%s' % item for item in args.items()))
print ('sys.version=%s' % (sys.version.strip().replace('\n', ' '), ))
print ('sys.path=%s' % pprint.pformat(sys.path))
print ('sys.modules=%s' % pprint.pformat(sorted(sys.modules.keys())))
print ('cwd=%s' % os.getcwd())
patch_all(**args)
if argv:
......@@ -242,4 +242,4 @@ MONKEY OPTIONS: --verbose %s""" % ', '.join('--[no-]%s' % m for m in modules)
__package__ = None
execfile(sys.argv[0])
else:
print script_help
print (script_help)
......@@ -230,7 +230,7 @@ Where /path/to/myapp.wsgi is a Python script that defines "application" callable
except AttributeError:
sys.exit("Could not find application in %s" % filename)
server = WSGIServer((options.interface, options.port), application, spawn=options.spawn)
print 'Serving %s on %s:%s' % (filename, options.interface, options.port)
print ('Serving %s on %s:%s' % (filename, options.interface, options.port))
server.serve_forever()
else:
sys.stderr.write(parser.format_help())
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment