From be24a54d9ce7e8819f6cb6857fb5db51b9d62bbc Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 23 Feb 2021 03:24:12 -0500 Subject: [PATCH] sync: update event is_set API Python 3 renamed this method from isSet to is_set. Change-Id: I8f9bb0b302d55873bed3cb20f2d994fa2d082157 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/297742 Reviewed-by: Michael Mortensen Tested-by: Mike Frysinger --- subcmds/sync.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/subcmds/sync.py b/subcmds/sync.py index 18d2256e..63e5bc7d 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py @@ -415,7 +415,7 @@ later is required to fix a server side protocol bug. for project_list in objdir_project_map.values(): # Check for any errors before running any more tasks. # ...we'll let existing threads finish, though. - if err_event.isSet() and opt.fail_fast: + if err_event.is_set() and opt.fail_fast: break sem.acquire() @@ -562,7 +562,7 @@ later is required to fix a server side protocol bug. for project in all_projects: # Check for any errors before running any more tasks. # ...we'll let existing threads finish, though. - if err_event.isSet() and opt.fail_fast: + if err_event.is_set() and opt.fail_fast: break sem.acquire() @@ -638,7 +638,7 @@ later is required to fix a server side protocol bug. sem.release() for bare_git in gc_gitdirs.values(): - if err_event.isSet() and opt.fail_fast: + if err_event.is_set() and opt.fail_fast: break sem.acquire() t = _threading.Thread(target=GC, args=(bare_git,)) @@ -949,7 +949,7 @@ later is required to fix a server side protocol bug. _PostRepoFetch(rp, opt.repo_verify) if opt.network_only: # bail out now; the rest touches the working tree - if err_event.isSet(): + if err_event.is_set(): print('\nerror: Exited sync due to fetch errors.\n', file=sys.stderr) sys.exit(1) return @@ -976,7 +976,7 @@ later is required to fix a server side protocol bug. fetched.update(self._Fetch(missing, opt, err_event)) # If we saw an error, exit with code 1 so that other scripts can check. - if err_event.isSet(): + if err_event.is_set(): err_network_sync = True if opt.fail_fast: print('\nerror: Exited sync due to fetch errors.\n' @@ -999,7 +999,7 @@ later is required to fix a server side protocol bug. err_results = [] self._Checkout(all_projects, opt, err_event, err_results) - if err_event.isSet(): + if err_event.is_set(): err_checkout = True # NB: We don't exit here because this is the last step. @@ -1009,7 +1009,7 @@ later is required to fix a server side protocol bug. print(self.manifest.notice) # If we saw an error, exit with code 1 so that other scripts can check. - if err_event.isSet(): + if err_event.is_set(): print('\nerror: Unable to fully sync the tree.', file=sys.stderr) if err_network_sync: print('error: Downloading network changes failed.', file=sys.stderr)