From 34d441fb878447e6fa025c8c668208d7044f6429 Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Mon, 7 Oct 2024 10:03:32 -0700 Subject: [PATCH] Remove get_password_hash, unused spwd is removed in Python 3.13. But fortunately, this function itself is never used. Part of: #1073 --- examples/the_basics.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/examples/the_basics.py b/examples/the_basics.py index 0dcd4049d..af9903b00 100644 --- a/examples/the_basics.py +++ b/examples/the_basics.py @@ -10,7 +10,6 @@ import hashlib import io import os -import spwd import mitogen.core import mitogen.master @@ -57,21 +56,6 @@ def streamy_download_file(context, path): } -def get_password_hash(username): - """ - Fetch a user's password hash. - """ - try: - h = spwd.getspnam(username) - except KeyError: - return None - - # mitogen.core.Secret() is a Unicode subclass with a repr() that hides the - # secret data. This keeps secret stuff out of logs. Like blobs, secrets can - # also be serialized. - return mitogen.core.Secret(h) - - def md5sum(path): """ Return the MD5 checksum for a file.