tests/hgweberror.py
changeset 36876 97f44b0720e2
parent 36865 3d60a22e27f5
child 36887 4daa22071d5d
--- a/tests/hgweberror.py	Sat Mar 10 16:17:51 2018 -0800
+++ b/tests/hgweberror.py	Sat Mar 10 20:16:20 2018 -0800
@@ -10,9 +10,12 @@
     '''Dummy web command that raises an uncaught Exception.'''
 
     # Simulate an error after partial response.
-    if 'partialresponse' in req.req.qsparams:
-        req.respond(200, 'text/plain')
-        req.write('partial content\n')
+    if 'partialresponse' in web.req.qsparams:
+        web.res.status = b'200 Script output follows'
+        web.res.headers[b'Content-Type'] = b'text/plain'
+        web.res.setbodywillwrite()
+        list(web.res.sendresponse())
+        web.res.getbodyfile().write(b'partial content\n')
 
     raise AttributeError('I am an uncaught error!')