Commits

Joel Rivera committed 985a5ca

Fix compatibility issues with python3 in the last changes. Close issue #1236

Comments (0)

Files changed (2)

cherrypy/lib/sessions.py

 expiration date, although this was on a system with an inaccurate system time.
 Maybe FF doesn't trust system time.
 """
-
+import sys
 import datetime
 import os
-import random
 import time
 import threading
 import types
                 return pickle.load(f)
             finally:
                 f.close()
-        except (IOError, EOFError), e:
+        except (IOError, EOFError):
+            e = sys.exc_info()[1]
             if self.debug:
                 cherrypy.log("Error loading the session pickle: %s" % e, 'TOOLS.SESSIONS')
             return None
 import re
 
 class cherrypy_build_py(build_py):
-    "Custom version of build_py that selects Python-specific wsgiserver"
+    "Custom version of build_py that selects Python-specific modules"
     def build_module(self, module, module_file, package):
         python3 = sys.version_info >= (3,)
         if python3:
-            exclude_pattern = re.compile('wsgiserver2|ssl_pyopenssl')
+            exclude_pattern = re.compile('wsgiserver2|ssl_pyopenssl|_cpcompat_subprocess')
         else:
             exclude_pattern = re.compile('wsgiserver3')
         if exclude_pattern.match(module):