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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-12-18 10:09:49 UTC
  • mfrom: (4871.5.4 admin-guide-submit)
  • Revision ID: pqm@pqm.ubuntu.com-20091218100949-2c1ityvnbqjtdf3g
(nmb) Add backup section to admin-guide

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2006, 2007, 2008, 2009 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
314
314
 
315
315
    :param override: If True, always set the ignore, if False, only set the
316
316
        ignore if there isn't already a filter.
317
 
    :return: A callable to remove the new warnings this added.
318
317
    """
319
318
    import warnings
320
319
    if not override and _check_for_filter(error_only=False):
322
321
        # then skip it.
323
322
        return
324
323
    warnings.filterwarnings('ignore', category=DeprecationWarning)
325
 
    filter = warnings.filters[0]
326
 
    def cleanup():
327
 
        warnings.filters.remove(filter)
328
 
    return cleanup
329
324
 
330
325
 
331
326
def activate_deprecation_warnings(override=True):