changeset 39834:d1e0b905c59d

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
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 25 Sep 2018 21:39:42 -0400
parents 28626957395a
children 91d63fd58e7d
files mercurial/hgweb/server.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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)