Commit 78688625 authored by maruel@chromium.org's avatar maruel@chromium.org

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
parent 1e08c00d
......@@ -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):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment