writelines() isn't used in our code base.
close() was a no-op. It is an optional method per PEP 3333.
My eventual goal is to kill the wsgirequest class, hence why I'm
removing code.
durin42 |
hg-reviewers |
writelines() isn't used in our code base.
close() was a no-op. It is an optional method per PEP 3333.
My eventual goal is to kill the wsgirequest class, hence why I'm
removing code.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/hgweb/request.py (7 lines) |
def write(self, thing): | def write(self, thing): | ||||
if thing: | if thing: | ||||
try: | try: | ||||
self.server_write(thing) | self.server_write(thing) | ||||
except socket.error as inst: | except socket.error as inst: | ||||
if inst[0] != errno.ECONNRESET: | if inst[0] != errno.ECONNRESET: | ||||
raise | raise | ||||
def writelines(self, lines): | |||||
for line in lines: | |||||
self.write(line) | |||||
def flush(self): | def flush(self): | ||||
return None | return None | ||||
def close(self): | |||||
return None | |||||
def wsgiapplication(app_maker): | def wsgiapplication(app_maker): | ||||
'''For compatibility with old CGI scripts. A plain hgweb() or hgwebdir() | '''For compatibility with old CGI scripts. A plain hgweb() or hgwebdir() | ||||
can and should now be used as a WSGI application.''' | can and should now be used as a WSGI application.''' | ||||
application = app_maker() | application = app_maker() | ||||
def run_wsgi(env, respond): | def run_wsgi(env, respond): | ||||
return application(env, respond) | return application(env, respond) | ||||
return run_wsgi | return run_wsgi |