Fixed B006 (mutable-argument-default): Do not use mutable data structures for argument defaults
This commit is contained in:
parent
922c59ddaf
commit
d1d3d08d70
|
@ -108,11 +108,13 @@ def sort_email_addresses(email_addresses, env):
|
|||
ret.extend(sorted(email_addresses)) # whatever is left
|
||||
return ret
|
||||
|
||||
def shell(method, cmd_args, env={}, capture_stderr=False, return_bytes=False, trap=False, input=None):
|
||||
def shell(method, cmd_args, env=None, capture_stderr=False, return_bytes=False, trap=False, input=None):
|
||||
# A safe way to execute processes.
|
||||
# Some processes like apt-get require being given a sane PATH.
|
||||
import subprocess
|
||||
|
||||
if env is None:
|
||||
env = {}
|
||||
env.update({ "PATH": "/sbin:/bin:/usr/sbin:/usr/bin" })
|
||||
kwargs = {
|
||||
'env': env,
|
||||
|
|
Loading…
Reference in New Issue