~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: Patch Queue Manager
  • Date: 2011-11-07 17:12:35 UTC
  • mfrom: (6241.1.2 cpu-count-bsd)
  • Revision ID: pqm@pqm.ubuntu.com-20111107171235-wf4yf2zza518tp2q
(jelmer) Fix osutils.local_concurrency() when run with newer versions on
 Python on Debian GNU/kFreeBSD. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2316
2316
    if concurrency is None:
2317
2317
        try:
2318
2318
            import multiprocessing
2319
 
        except ImportError:
 
2319
            concurrency = multiprocessing.cpu_count()
 
2320
        except (ImportError, NotImplementedError):
2320
2321
            # multiprocessing is only available on Python >= 2.6
 
2322
            # and multiprocessing.cpu_count() isn't implemented on all
 
2323
            # platforms
2321
2324
            try:
2322
2325
                concurrency = _local_concurrency()
2323
2326
            except (OSError, IOError):
2324
2327
                pass
2325
 
        else:
2326
 
            concurrency = multiprocessing.cpu_count()
2327
2328
    try:
2328
2329
        concurrency = int(concurrency)
2329
2330
    except (TypeError, ValueError):