/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/chk_map.py

  • Committer: John Arbash Meinel
  • Date: 2009-11-02 17:15:20 UTC
  • mto: (4668.1.3 2.1.0b2)
  • mto: This revision was merged to the branch mainline in revision 4782.
  • Revision ID: john@arbash-meinel.com-20091102171520-8udwpeq12bnz1vkb
Fix bug #471193, allow tuples into the CHK code.

Instead of raising a TypeError immediately, add a debug flag and only
raise TypeErrors if that flag is set. Sort of like how we did
ensure_unicode() for api changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
720
720
        :param bytes: The bytes of the node.
721
721
        :param key: The key that the serialised node has.
722
722
        """
 
723
        key = static_tuple.expect_static_tuple(key)
723
724
        return _deserialise_leaf_node(bytes, key,
724
725
                                      search_key_func=search_key_func)
725
726
 
1018
1019
        :param key: The key that the serialised node has.
1019
1020
        :return: An InternalNode instance.
1020
1021
        """
1021
 
        if type(key) is not StaticTuple:
1022
 
            raise AssertionError('deserialise should be called with a'
1023
 
                                 ' StaticTuple not %s' % (type(key),))
 
1022
        key = static_tuple.expect_static_tuple(key)
1024
1023
        return _deserialise_internal_node(bytes, key,
1025
1024
                                          search_key_func=search_key_func)
1026
1025