]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Avoid `__file__` in `hashlib` example (GH-134540)
authorJosh Cannon <joshdcannon@gmail.com>
Thu, 22 May 2025 21:32:00 +0000 (16:32 -0500)
committerGitHub <noreply@github.com>
Thu, 22 May 2025 21:32:00 +0000 (14:32 -0700)
Doc/library/hashlib.rst

index bb2d2fad23bdb8a8002b74a67338fc7b271a04be..4818a4944a512a43bff061831af071edaa8f0acb 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