diff --git a/contrib/buildbot/shieldio.py b/contrib/buildbot/shieldio.py --- a/contrib/buildbot/shieldio.py +++ b/contrib/buildbot/shieldio.py @@ -31,7 +31,8 @@ scheme, netloc, path, - unquote(urlencode({**self.query, **kwargs}, doseq=True, quote_via=quote)), + unquote(urlencode({**self.query, **kwargs}, + doseq=True, quote_via=quote)), '' )) diff --git a/contrib/buildbot/test/mocks/phabricator.py b/contrib/buildbot/test/mocks/phabricator.py --- a/contrib/buildbot/test/mocks/phabricator.py +++ b/contrib/buildbot/test/mocks/phabricator.py @@ -10,7 +10,7 @@ class Result: - def __init__(self, data=[]): + def __init__(self, data: list): self.data = data diff --git a/contrib/buildbot/test/mocks/slackbot.py b/contrib/buildbot/test/mocks/slackbot.py --- a/contrib/buildbot/test/mocks/slackbot.py +++ b/contrib/buildbot/test/mocks/slackbot.py @@ -47,9 +47,8 @@ } -def users_list(total=1, initialUsers=[]): - users = [] - users.extend(initialUsers) +def users_list(total=1, initialUsers=None): + users = initialUsers if initialUsers is not None else [] for i in range(len(users), total): users.append(user('U{}'.format(DEFAULT_USER_NUM + i))) return { diff --git a/contrib/teamcity/build-configurations.py b/contrib/teamcity/build-configurations.py --- a/contrib/teamcity/build-configurations.py +++ b/contrib/teamcity/build-configurations.py @@ -369,7 +369,8 @@ ) continue - def run_process(self, binary, args=[]): + def run_process(self, binary, args=None): + args = args if args is not None else [] return asyncio.create_subprocess_exec( *([binary] + args), # Buffer limit is 64KB by default, but we need a larger buffer: @@ -386,7 +387,8 @@ }, ) - async def run_build(self, binary, args=[]): + async def run_build(self, binary, args=None): + args = args if args is not None else [] proc = await self.run_process(binary, args) await asyncio.wait([ @@ -395,7 +397,8 @@ return await proc.wait() - async def wait_for_build(self, timeout, args=[]): + async def wait_for_build(self, timeout, args=None): + args = args if args is not None else [] message = "Build {} completed successfully".format( self.configuration.name ) @@ -434,7 +437,8 @@ return (return_code, message) - def run(self, args=[]): + def run(self, args=None): + args = args if args is not None else [] if self.artifact_dir.is_dir(): shutil.rmtree(self.artifact_dir) self.artifact_dir.mkdir(exist_ok=True) @@ -478,7 +482,9 @@ ) self.teamcity_messages.publishArtifacts(artifact_path_pattern) - def run(self, args=[]): + def run(self, args=None): + args = args if args is not None else [] + # Let the user know what build is being run. # This makes it easier to retrieve the info from the logs. self.teamcity_messages.customMessage(