~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: John Arbash Meinel
  • Date: 2009-06-04 21:25:46 UTC
  • mfrom: (4409 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4410.
  • Revision ID: john@arbash-meinel.com-20090604212546-dpmrzvg49q40tvnj
Merge bzr.dev 4409, resolve NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
3062
3062
    try:
3063
3063
        content = file('/proc/cpuinfo', 'rb').read()
3064
3064
        concurrency = cpucount(content)
3065
 
    except Exception, e:
 
3065
        return concurrency
 
3066
    except IOError:
 
3067
        pass
 
3068
 
 
3069
    try:
 
3070
       output = Popen(['sysctl', '-n', 'hw.availcpu'],
 
3071
                      stdout=PIPE).communicate()[0]
 
3072
       concurrency = int(output)
 
3073
       return concurrency
 
3074
    except (OSError, IOError):
3066
3075
        concurrency = 1
 
3076
 
3067
3077
    return concurrency
3068
3078
 
3069
3079