~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/features.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-08-09 12:34:00 UTC
  • mfrom: (6056.2.5 option-registry)
  • Revision ID: pqm@pqm.ubuntu.com-20110809123400-x521f2j9jkxx8ze2
(vila) Introduce OptionRegistry (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
"""
19
19
 
20
20
import os
21
 
import subprocess
22
21
import stat
23
22
import sys
24
23
import tempfile
166
165
        self.module_name = module_name
167
166
 
168
167
    def _probe(self):
169
 
        sentinel = object()
170
 
        module = sys.modules.get(self.module_name, sentinel)
171
 
        if module is sentinel:
172
 
            try:
173
 
                self._module = __import__(self.module_name, {}, {}, [''])
174
 
                return True
175
 
            except ImportError:
176
 
                return False
177
 
        else:
178
 
            self._module = module
 
168
        try:
 
169
            self._module = __import__(self.module_name, {}, {}, [''])
179
170
            return True
 
171
        except ImportError:
 
172
            return False
180
173
 
181
174
    @property
182
175
    def module(self):