warnings.catch_warnings() is only available on python 2.5

Review URL: http://codereview.chromium.org/115881

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@17114 0039d316-1c4b-4281-b951-d872f2087c98
experimental/szager/collated-output
maruel@chromium.org 17 years ago
parent 1e08c00d60
commit 786886257e

@ -21,7 +21,11 @@ import presubmit_canned_checks
class PresubmitTestsBase(unittest.TestCase):
"""Setups and tear downs the mocks but doesn't test anything as-is."""
def setUp(self):
self._warnings_stack = warnings.catch_warnings()
if hasattr(warnings, 'catch_warnings'):
self._warnings_stack = warnings.catch_warnings()
else:
self._warnings_stack = None
warnings.simplefilter("ignore", DeprecationWarning)
self.original_IsFile = os.path.isfile
def MockIsFile(f):

Loading…
Cancel
Save