mirror of
https://github.com/zulip/zulip.git
synced 2025-11-08 16:01:58 +00:00
More removal of mutable default arguments.
I've left a few that clearly aren't being passed and aren't being mutated, but I think I've gotten the rest of them.
This commit is contained in:
committed by
Tim Abbott
parent
5fe9076631
commit
04c71fadc6
@@ -110,14 +110,14 @@ REPO_STOPWORDS_PATH = os.path.join(
|
||||
|
||||
LOUD = dict(_out=sys.stdout, _err=sys.stderr)
|
||||
|
||||
def setup_virtualenv(target_venv_path, requirements_file, virtualenv_args=[]):
|
||||
def setup_virtualenv(target_venv_path, requirements_file, virtualenv_args=None):
|
||||
# Check if a cached version already exists
|
||||
output = subprocess.check_output(['sha1sum', requirements_file])
|
||||
sha1sum = output.split()[0]
|
||||
cached_venv_path = os.path.join(VENV_CACHE_PATH, sha1sum, os.path.basename(target_venv_path))
|
||||
success_stamp = os.path.join(cached_venv_path, "success-stamp")
|
||||
if not os.path.exists(success_stamp):
|
||||
do_setup_virtualenv(cached_venv_path, requirements_file, virtualenv_args)
|
||||
do_setup_virtualenv(cached_venv_path, requirements_file, virtualenv_args or [])
|
||||
run(["touch", success_stamp])
|
||||
|
||||
print("Using cached Python venv from %s" % (cached_venv_path,))
|
||||
|
||||
@@ -220,6 +220,6 @@ class CodeHiliteExtension(markdown.Extension):
|
||||
md.registerExtension(self)
|
||||
|
||||
|
||||
def makeExtension(configs={}):
|
||||
return CodeHiliteExtension(configs=configs)
|
||||
def makeExtension(configs=None):
|
||||
return CodeHiliteExtension(configs=configs or [])
|
||||
|
||||
|
||||
@@ -22,9 +22,13 @@ from zproject.backends import ZulipDummyBackend, EmailAuthBackend, \
|
||||
import ujson
|
||||
|
||||
class AuthBackendTest(TestCase):
|
||||
def verify_backend(self, backend, good_args={},
|
||||
good_kwargs={}, bad_kwargs=None,
|
||||
def verify_backend(self, backend, good_args=None,
|
||||
good_kwargs=None, bad_kwargs=None,
|
||||
email_to_username=None):
|
||||
if good_args is None:
|
||||
good_args = []
|
||||
if good_kwargs is None:
|
||||
good_kwargs = {}
|
||||
email = "hamlet@zulip.com"
|
||||
user_profile = get_user_profile_by_email(email)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user