From bc37c729ff4e3d02e324e1d489eec4054ea2650c Mon Sep 17 00:00:00 2001 From: Scott Sanderson Date: Mon, 20 Apr 2015 16:47:50 -0400 Subject: [PATCH] DEV: Failover for urrlib.parse.quote in PY2. --- jupyterhub/singleuser.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/jupyterhub/singleuser.py b/jupyterhub/singleuser.py index ccc65a21..c911b631 100644 --- a/jupyterhub/singleuser.py +++ b/jupyterhub/singleuser.py @@ -5,7 +5,11 @@ # Distributed under the terms of the Modified BSD License. import os -from urllib.parse import quote +try: + from urllib.parse import quote +except ImportError: + # PY2 Compat + from urllib import quote import requests from jinja2 import ChoiceLoader, FunctionLoader @@ -177,7 +181,7 @@ class SingleUserNotebookApp(NotebookApp): self._clear_cookie_cache, self.cookie_cache_lifetime * 1e3, ).start() - super().start() + super(SingleUserNotebookApp, self).start() def init_webapp(self): # load the hub related settings into the tornado settings dict