aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python/examples/howto/sign-key.py
diff options
context:
space:
mode:
authorBen McGinnes <[email protected]>2018-12-05 14:50:52 +0000
committerBen McGinnes <[email protected]>2018-12-05 14:50:52 +0000
commitdc5600d306f808767068bad5117232fc3d35ac43 (patch)
treecf30c1648d73aed25ae258c04d9dd8086b70ef73 /lang/python/examples/howto/sign-key.py
parentpython: windows c and cython (diff)
downloadgpgme-dc5600d306f808767068bad5117232fc3d35ac43.tar.gz
gpgme-dc5600d306f808767068bad5117232fc3d35ac43.zip
python: examples
* cut some of then poor len usage.
Diffstat (limited to 'lang/python/examples/howto/sign-key.py')
-rwxr-xr-xlang/python/examples/howto/sign-key.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lang/python/examples/howto/sign-key.py b/lang/python/examples/howto/sign-key.py
index 55d517b9..f9c90d76 100755
--- a/lang/python/examples/howto/sign-key.py
+++ b/lang/python/examples/howto/sign-key.py
@@ -53,11 +53,11 @@ else:
fpr = "".join(fpr0.split())
key = c.get_key(fpr, secret=False)
-if len(userid) > 0 and sig_type.lower() == "local":
+if userid and sig_type.lower() == "local":
c.key_sign(key, uids=userid, local=True)
-elif len(userid) > 0 and sig_type.lower() != "local":
+elif userid and sig_type.lower() != "local":
c.key_sign(key, uids=userid)
-elif len(userid) == 0 and sig_type.lower() == "local":
+elif not userid and sig_type.lower() == "local":
c.key_sign(key, local=True)
else:
c.key_sign(key)