##// END OF EJS Templates
hgweb: deduplicate code...
Manuel Jacob -
r45540:839328c5 stable
parent child Browse files
Show More
@@ -162,11 +162,11 b' def parserequestfromenv(env, reponame=No'
162 162 # strings on Python 3 must be between \00000-\000FF. We deal with bytes
163 163 # in Mercurial, so mass convert string keys and values to bytes.
164 164 if pycompat.ispy3:
165 env = {k.encode('latin-1'): v for k, v in pycompat.iteritems(env)}
166 env = {
167 k: v.encode('latin-1') if isinstance(v, str) else v
168 for k, v in pycompat.iteritems(env)
169 }
165 def tobytes(s):
166 if not isinstance(s, str):
167 return s
168 return s.encode('latin-1')
169 env = {tobytes(k): tobytes(v) for k, v in pycompat.iteritems(env)}
170 170
171 171 # Some hosting solutions are emulating hgwebdir, and dispatching directly
172 172 # to an hgweb instance using this environment variable. This was always
General Comments 0
You need to be logged in to leave comments. Login now