py3: conditionalize access to socketserver.ForkingMixIn
This is no longer exported on platforms that don't support forking, as of 3.6.
https://github.com/python/cpython/commit/
aadff9bea61a2fc9f4cf0f213f0ee50fc54d6574
--- a/mercurial/hgweb/server.py Tue Sep 25 22:46:18 2018 -0400
+++ b/mercurial/hgweb/server.py Tue Sep 25 21:39:42 2018 -0400
@@ -174,8 +174,12 @@
env[r'wsgi.errors'] = _error_logger(self)
env[r'wsgi.multithread'] = isinstance(self.server,
socketserver.ThreadingMixIn)
- env[r'wsgi.multiprocess'] = isinstance(self.server,
- socketserver.ForkingMixIn)
+ if util.safehasattr(socketserver, 'ForkingMixIn'):
+ env[r'wsgi.multiprocess'] = isinstance(self.server,
+ socketserver.ForkingMixIn)
+ else:
+ env[r'wsgi.multiprocess'] = False
+
env[r'wsgi.run_once'] = 0
wsgiref.validate.check_environ(env)