summaryrefslogtreecommitdiffhomepage
path: root/demos/demo_keygen.py
diff options
context:
space:
mode:
authormagmaus3 <magmaus3@disroot.org>2023-02-14 12:36:10 +0100
committerMikael Magnusson <mikma@users.sourceforge.net>2023-08-02 22:07:45 +0200
commit4753b3619dd0f08185c16e3d3d60b98afdbaa040 (patch)
tree62b2ad6b595977471f649671ae7c5bb66282088c /demos/demo_keygen.py
parentd5117fc7988e3ede445ca09d7ffc95d4263445c3 (diff)
Don't use functions from nonexistent py3compat module in demos.py3compat
commit 36bafee8af15d7743fd9f16b7a6b146b4e90de0e Author: magmaus3 <magmaus3@disroot.org> Date: Tue Feb 14 12:36:10 2023 +0100 Don't use functions from nonexistent py3compat module in demos.
Diffstat (limited to 'demos/demo_keygen.py')
-rwxr-xr-xdemos/demo_keygen.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/demos/demo_keygen.py b/demos/demo_keygen.py
index 12637ed0..590a0c4f 100755
--- a/demos/demo_keygen.py
+++ b/demos/demo_keygen.py
@@ -26,7 +26,6 @@ from optparse import OptionParser
from paramiko import DSSKey
from paramiko import RSAKey
from paramiko.ssh_exception import SSHException
-from paramiko.py3compat import u
usage = """
%prog [-v] [-b bits] -t type [-N new_passphrase] [-f output_keyfile]"""
@@ -144,9 +143,7 @@ if __name__ == "__main__":
raise SSHException("DSA Keys must be 1024 bits")
if ktype not in key_dispatch_table:
- raise SSHException(
- "Unknown %s algorithm to generate keys pair" % ktype
- )
+ raise SSHException("Unknown %s algorithm to generate keys pair" % ktype)
# generating private key
prv = key_dispatch_table[ktype].generate(bits=bits, progress_func=pfunc)
@@ -162,7 +159,7 @@ if __name__ == "__main__":
if options.verbose:
print("done.")
- hash = u(hexlify(pub.get_fingerprint()))
+ hash = hexlify(pub.get_fingerprint()).decode()
print(
"Fingerprint: %d %s %s.pub (%s)"
% (