Mercurial > hg
changeset 20529:ca970d6acedb stable
hgweb: make sure sys module is loaded prior to reload hack
If sys is still a demandmod, reload(sys) fails with "TypeError: reload()
argument must be module".
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 19 Feb 2014 21:16:43 +0900 |
parents | f2a0a0e76b4c |
children | 78f547cdc362 |
files | mercurial/hgweb/server.py |
diffstat | 1 files changed, 1 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/hgweb/server.py Sat Feb 15 16:19:19 2014 +0900 +++ b/mercurial/hgweb/server.py Wed Feb 19 21:16:43 2014 +0900 @@ -331,6 +331,7 @@ # as ascii (clown fail), because the default Python Unicode # codec is hardcoded as ascii. + sys.argv # unwrap demand-loader so that reload() works reload(sys) # resurrect sys.setdefaultencoding() oldenc = sys.getdefaultencoding() sys.setdefaultencoding("latin1") # or any full 8-bit encoding