comparison mercurial/hgweb/server.py @ 30639:d524c88511a7

py3: replace os.name with pycompat.osname (part 1 of 2) os.name returns unicodes on py3 and we have pycompat.osname which returns bytes. This series of 2 patches will change every ocurrence of os.name with pycompat.osname.
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 19 Dec 2016 00:16:52 +0530
parents dd3dd80fca10
children ac96ff471c9a
comparison
equal deleted inserted replaced
30638:1c5cbf28f007 30639:d524c88511a7
16 16
17 from ..i18n import _ 17 from ..i18n import _
18 18
19 from .. import ( 19 from .. import (
20 error, 20 error,
21 pycompat,
21 util, 22 util,
22 ) 23 )
23 24
24 httpservermod = util.httpserver 25 httpservermod = util.httpserver
25 socketserver = util.socketserver 26 socketserver = util.socketserver
264 return default 265 return default
265 266
266 class MercurialHTTPServer(_mixin, httpservermod.httpserver, object): 267 class MercurialHTTPServer(_mixin, httpservermod.httpserver, object):
267 268
268 # SO_REUSEADDR has broken semantics on windows 269 # SO_REUSEADDR has broken semantics on windows
269 if os.name == 'nt': 270 if pycompat.osname == 'nt':
270 allow_reuse_address = 0 271 allow_reuse_address = 0
271 272
272 def __init__(self, ui, app, addr, handler, **kwargs): 273 def __init__(self, ui, app, addr, handler, **kwargs):
273 httpservermod.httpserver.__init__(self, addr, handler, **kwargs) 274 httpservermod.httpserver.__init__(self, addr, handler, **kwargs)
274 self.daemon_threads = True 275 self.daemon_threads = True