--- a/mercurial/hgweb/server.py Thu Mar 11 11:21:48 2010 +0100
+++ b/mercurial/hgweb/server.py Thu Mar 11 13:28:39 2010 +0100
@@ -195,8 +195,17 @@
self.close_connection = True
pass
+try:
+ from threading import activeCount
+ _mixin = SocketServer.ThreadingMixIn
+except ImportError:
+ if hasattr(os, "fork"):
+ _mixin = SocketServer.ForkingMixIn
+ else:
+ class _mixin:
+ pass
+
def create_server(ui, repo):
- use_threads = True
def openlog(opt, default):
if opt and opt != '-':
@@ -218,21 +227,6 @@
accesslog = openlog(myui.config("web", "accesslog", "-"), sys.stdout)
errorlog = openlog(myui.config("web", "errorlog", "-"), sys.stderr)
- if use_threads:
- try:
- from threading import activeCount
- except ImportError:
- use_threads = False
-
- if use_threads:
- _mixin = SocketServer.ThreadingMixIn
- else:
- if hasattr(os, "fork"):
- _mixin = SocketServer.ForkingMixIn
- else:
- class _mixin:
- pass
-
if webdir_conf:
hgwebobj = hgwebdir(webdir_conf, ui)
elif repo is not None: