From c9144527d9f37bbd59e8776150d99adf23f072a5 Mon Sep 17 00:00:00 2001 From: Edward Lemur Date: Wed, 30 Oct 2019 21:29:10 +0000 Subject: [PATCH] depot_tools: Don't use basestring in scm.CaptureStatus. basestring doesn't exist in Python 3. scm.Capture status doesn't need to support strings either. Bug: 1002209 Change-Id: Ie9edfdfd09b789bfaace038a6ad8f3a7da344bc4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1890925 Reviewed-by: Anthony Polito Commit-Queue: Edward Lesmes --- scm.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/scm.py b/scm.py index e102e8d107..a1699fb6de 100644 --- a/scm.py +++ b/scm.py @@ -121,7 +121,7 @@ class GIT(object): def CaptureStatus(files, cwd, upstream_branch): """Returns git status. - @files can be a string (one file) or a list of files. + @files is a list of files. Returns an array of (status, file) tuples.""" if upstream_branch is None: @@ -130,11 +130,7 @@ class GIT(object): raise gclient_utils.Error('Cannot determine upstream branch') command = ['-c', 'core.quotePath=false', 'diff', '--name-status', '--no-renames', '-r', '%s...' % upstream_branch] - if not files: - pass - elif isinstance(files, basestring): - command.append(files) - else: + if files: command.extend(files) status = GIT.Capture(command, cwd) results = []