mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
fixes for py27
This commit is contained in:
parent
8d453fb341
commit
bb00d41ff9
@ -137,8 +137,6 @@ class SettingMeta(type):
|
||||
setattr(cls, "short", desc.splitlines()[0])
|
||||
|
||||
class Setting(object):
|
||||
__metaclass__ = SettingMeta
|
||||
|
||||
name = None
|
||||
value = None
|
||||
section = None
|
||||
|
||||
@ -282,10 +282,6 @@ _add_doc(u, """Text literal""")
|
||||
|
||||
if PY3:
|
||||
|
||||
def execfile_(fname, *args):
|
||||
return exec(compile(open(fname, 'rb').read(), fname, 'exec'), *args)
|
||||
|
||||
|
||||
import builtins
|
||||
exec_ = getattr(builtins, "exec")
|
||||
|
||||
@ -296,6 +292,11 @@ if PY3:
|
||||
|
||||
|
||||
print_ = getattr(builtins, "print")
|
||||
|
||||
def execfile_(fname, *args):
|
||||
return exec_(compile(open(fname, 'rb').read(), fname, 'exec'), *args)
|
||||
|
||||
|
||||
del builtins
|
||||
|
||||
else:
|
||||
@ -395,4 +396,4 @@ else:
|
||||
urlparse = orig_urlparse.urlparse
|
||||
|
||||
import urllib
|
||||
urlunquote = urllib.unquote
|
||||
unquote = urllib.unquote
|
||||
|
||||
@ -79,8 +79,8 @@ class request(object):
|
||||
yield lines
|
||||
|
||||
def send_bytes(self):
|
||||
for d in str(self.data, "latin1"):
|
||||
yield bytes(d, "latin1")
|
||||
for d in str(self.data.decode("latin1")):
|
||||
yield bytes(d.encode("latin1"))
|
||||
|
||||
def send_random(self):
|
||||
maxs = round(len(self.data) / 10)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user