/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/features.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-01-25 13:59:32 UTC
  • mfrom: (5321.1.119 mergetools)
  • Revision ID: pqm@pqm.ubuntu.com-20110125135932-0o8d07i3j1flp6ou
(vila) Added external merge tool management module,
 bzrlib.mergetools. (Gordon Tyler)

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import os
20
20
import stat
21
21
 
22
 
from bzrlib import tests
 
22
from bzrlib import (
 
23
    osutils,
 
24
    tests,
 
25
    )
23
26
 
24
27
 
25
28
class _NotRunningAsRoot(tests.Feature):
113
116
        return self._path
114
117
 
115
118
    def _probe(self):
116
 
        path = os.environ.get('PATH')
117
 
        if path is None:
118
 
            return False
119
 
        for d in path.split(os.pathsep):
120
 
            if d:
121
 
                f = os.path.join(d, self.name)
122
 
                if os.access(f, os.X_OK):
123
 
                    self._path = f
124
 
                    return True
125
 
        return False
 
119
        self._path = osutils.find_executable_on_path(self.name)
 
120
        return self._path is not None
126
121
 
127
122
    def feature_name(self):
128
123
        return '%s executable' % self.name