]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] Avoid `__file__` in `hashlib` example (GH-134540) (#134550)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 22 May 2025 21:38:04 +0000 (23:38 +0200)
committerGitHub <noreply@github.com>
Thu, 22 May 2025 21:38:04 +0000 (21:38 +0000)
Avoid `__file__` in `hashlib` example (GH-134540)
(cherry picked from commit 9b292ff0223dab0f999d5c1e13355552fd7cd528)

Co-authored-by: Josh Cannon <joshdcannon@gmail.com>
Doc/library/hashlib.rst

index ff15a08a792ed27df2039ff425e57b30b2a6a782..1c5d951560e24742414f59c4ad18900b66f21316 100644 (file)
@@ -284,7 +284,7 @@ a file or file-like object.
    Example:
 
       >>> import io, hashlib, hmac
-      >>> with open(hashlib.__file__, "rb") as f:
+      >>> with open("library/hashlib.rst", "rb") as f:
       ...     digest = hashlib.file_digest(f, "sha256")
       ...
       >>> digest.hexdigest()  # doctest: +ELLIPSIS