Apply suggestions from code review

Co-authored-by: Min RK <benjaminrk@gmail.com>
This commit is contained in:
Erik Sundell
2021-01-26 12:44:17 +01:00
committed by GitHub
parent cba22751b4
commit 4c3a32b51f

View File

@@ -862,7 +862,7 @@ class JupyterHub(Application):
def _validate_secret_key(self, proposal):
"""Coerces strings with even number of hexadecimal characters to bytes."""
r = proposal['value']
if type(r) == str:
if isinstance(r, str):
try:
return bytes.fromhex(r)
except ValueError: