[3.14] Avoid __file__ in hashlib example (GH-134540) (#134549)

Avoid `__file__` in `hashlib` example (GH-134540)
(cherry picked from commit 9b292ff022)

Co-authored-by: Josh Cannon <joshdcannon@gmail.com>
This commit is contained in:
Miss Islington (bot) 2025-05-22 23:37:52 +02:00 committed by GitHub
parent 37c2c8c9d8
commit 06a3a85f15
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -284,7 +284,7 @@ a file or file-like object.
Example: Example:
>>> import io, hashlib, hmac >>> 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 = hashlib.file_digest(f, "sha256")
... ...
>>> digest.hexdigest() # doctest: +ELLIPSIS >>> digest.hexdigest() # doctest: +ELLIPSIS