From: Joe Guo Date: Mon, 30 Jul 2018 01:56:55 +0000 (+1200) Subject: python/samba/tests: fix SamDB dummy replacement X-Git-Tag: tdb-1.3.17~2142 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2f37149341afae74738bfd6560333b75edf2b89f;p=thirdparty%2Fsamba.git python/samba/tests: fix SamDB dummy replacement In commit 6de9d878b, a dummy SamDB lambda was added: SamDB = lambda *x: None The `*x` will only cover positional args. If we call it with kwargs: samdb = SamDB(url=url) We will get TypeError: () got an unexpected keyword argument 'url' This commit fix this. It also fix PEP8 E731: do not assign a lambda expression, use a def BUG: https://bugzilla.samba.org/show_bug.cgi?id=13542 Signed-off-by: Joe Guo Reviewed-by: Andrew Bartlett Reviewed-by: Douglas Bagnall --- diff --git a/python/samba/tests/__init__.py b/python/samba/tests/__init__.py index dcee691e6e9..97ce8d1c495 100644 --- a/python/samba/tests/__init__.py +++ b/python/samba/tests/__init__.py @@ -43,7 +43,9 @@ try: except ImportError: # We are built without samdb support, # imitate it so that connect_samdb() can recover - SamDB = lambda *x: None + def SamDB(*args, **kwargs): + return None + import samba.ndr import samba.dcerpc.dcerpc import samba.dcerpc.epmapper