mirror of
https://github.com/python/cpython.git
synced 2025-09-12 11:46:52 +00:00
[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:
parent
37c2c8c9d8
commit
06a3a85f15
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue