[3.13] Avoid __file__ in hashlib example (GH-134540) (#134550)

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:38:04 +02:00 committed by GitHub
parent 79f20f1191
commit b212653049
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:
>>> 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