Anonymous avatar Anonymous committed a1ec97f

Fix python 2.4 / 2.5

Comments (0)

Files changed (3)

 cov-core
 ========
 
-This is a lib package for use by pytest-cov, nose-cov and unittest2-cov.  Unless your developing a
+This is a lib package for use by pytest-cov, nose-cov and nose2-cov.  Unless your developing a
 coverage plugin for a test framework then you probably want one of those.
 from cov_core_init import UNIQUE_SEP
 import cov_core_init
 import coverage
-import multiprocessing.util
 import socket
 import sys
 import os
 
 
+def multiprocessing_hook():
+    try:
+        import multiprocessing.util
+        multiprocessing.util.register_after_fork(multiprocessing_start,
+                                                 multiprocessing_start)
+    except ImportError:
+        pass
+
+
 def multiprocessing_start(obj):
     cov = cov_core_init.init()
     if cov:
+        import multiprocessing.util
         multiprocessing.util.Finalize(None,
                                       multiprocessing_finish,
                                       args=(cov,),
         os.environ['COV_CORE_SOURCE'] = UNIQUE_SEP.join(self.cov_source)
         os.environ['COV_CORE_DATA_FILE'] = self.cov_data_file
         os.environ['COV_CORE_CONFIG'] = self.cov_config
-        multiprocessing.util.register_after_fork(multiprocessing_start, multiprocessing_start)
+        multiprocessing_hook()
 
     @staticmethod
     def unset_env():
 ''' % (PTH_FILE_NAME, PTH_FILE)
 
 setuptools.setup(name='cov-core',
-                 version='1.5',
+                 version='1.6',
                  description='plugin core for use by pytest-cov, nose-cov and nose2-cov',
                  long_description=open('README.txt').read().strip(),
                  author='Meme Dough',
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.