diff -r d60678a567a9 -r 328739ea70c3 mercurial/hgweb/common.py --- a/mercurial/hgweb/common.py Tue Jun 23 22:38:21 2015 -0700 +++ b/mercurial/hgweb/common.py Tue Jun 23 22:20:08 2015 -0700 @@ -153,7 +153,7 @@ req.respond(HTTP_OK, ct, body=data) except TypeError: raise ErrorResponse(HTTP_SERVER_ERROR, 'illegal filename') - except OSError, err: + except OSError as err: if err.errno == errno.ENOENT: raise ErrorResponse(HTTP_NOT_FOUND) else: