Commit e6a4ab30 authored by dpranke@chromium.org's avatar dpranke@chromium.org

merge in fixes for python 2.5

R=maruel@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@79942 0039d316-1c4b-4281-b951-d872f2087c98
parent b35c00ce
......@@ -17,9 +17,10 @@ BASIC_EMAIL_REGEXP = r'^[\w\-\+\%\.]+\@[\w\-\+\%\.]+$'
def _assert_is_collection(obj):
assert (isinstance(obj, collections.Iterable) and
isinstance(obj, collections.Sized) and
not isinstance(obj, basestring))
assert not isinstance(obj, basestring)
if hasattr(collections, 'Iterable') and hasattr(collections, 'Sized'):
assert (isinstance(obj, collections.Iterable) and
isinstance(obj, collections.Sized))
class SyntaxErrorInOwnersFile(Exception):
......
......@@ -109,8 +109,9 @@ class OwnersDatabaseTest(unittest.TestCase):
# Check that we're passed in a sequence that isn't a string.
self.assertRaises(AssertionError, db.files_not_covered_by, 'foo', [])
self.assertRaises(AssertionError, db.files_not_covered_by,
(f for f in ['x', 'y']), [])
if hasattr(owners.collections, 'Iterable'):
self.assertRaises(AssertionError, db.files_not_covered_by,
(f for f in ['x', 'y']), [])
# Check that the files are under the root.
db.root = '/checkout'
......@@ -139,7 +140,9 @@ class OwnersDatabaseTest(unittest.TestCase):
# Check that we're passed in a sequence that isn't a string.
self.assertRaises(AssertionError, db.reviewers_for, 'foo')
self.assertRaises(AssertionError, db.reviewers_for, (f for f in ['x', 'y']))
if hasattr(owners.collections, 'Iterable'):
self.assertRaises(AssertionError, db.reviewers_for,
(f for f in ['x', 'y']))
# Check that the files are under the root.
db.root = '/checkout'
......
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