mirror of
https://github.com/samba-team/samba.git
synced 2025-01-31 01:48:16 +03:00
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: <lambda>() 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 <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
parent
d313e0e48d
commit
2f37149341
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user