~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/safe_open.py

  • Committer: Jelmer Vernooij
  • Date: 2011-12-22 04:04:43 UTC
  • mto: (6437.3.23 2.5)
  • mto: This revision was merged to the branch mainline in revision 6451.
  • Revision ID: jelmer@samba.org-20111222040443-1y83m6ik3jmcfo5m
Avoid assert.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Safe branch opening."""
18
18
 
 
19
from __future__ import absolute_import
 
20
 
19
21
import threading
20
22
 
21
23
from bzrlib import (
258
260
 
259
261
    def run_with_transform_fallback_location_hook_installed(
260
262
            self, callable, *args, **kw):
261
 
        assert (self.transform_fallback_locationHook in
262
 
                Branch.hooks['transform_fallback_location'])
 
263
        if (self.transform_fallback_locationHook not in
 
264
                Branch.hooks['transform_fallback_location']):
 
265
            raise AssertionError("hook not installed")
263
266
        self._threading_data.opener = self
264
267
        try:
265
268
            return callable(*args, **kw)