We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 934e480 commit f16b073Copy full SHA for f16b073
notebook/notebookapp.py
@@ -11,6 +11,8 @@
11
import datetime
12
import errno
13
import gettext
14
+import hashlib
15
+import hmac
16
import importlib
17
import io
18
import json
@@ -27,7 +29,6 @@
27
29
import time
28
30
import warnings
31
import webbrowser
-import hmac
32
33
try: #PY3
34
from base64 import encodebytes
@@ -706,7 +707,7 @@ def _default_cookie_secret(self):
706
707
else:
708
key = encodebytes(os.urandom(32))
709
self._write_cookie_secret_file(key)
- h = hmac.HMAC(key, digestmod='sha256')
710
+ h = hmac.new(key, digestmod=hashlib.sha256)
711
h.update(self.password.encode())
712
return h.digest()
713
0 commit comments