[PATCH 06 of 24 Openidrelay cube] [py3] fix imports related to urllib

Nsukami Patrick ptrck at nskm.xyz
Wed Apr 1 09:53:49 CEST 2020


# HG changeset patch
# User Nsukami Patrick <ptrck at nskm dot xyz>
# Date 1585508996 0
#      Sun Mar 29 19:09:56 2020 +0000
# Node ID e65777580e59e45707ec56469fa9716468da40e9
# Parent  34dbd72f64bb593ad691327ce4d172d04736c297
[py3] fix imports related to urllib

- fix deprecated imports, urllib.parse instead of urlparse
- fix typo, urlquote instead of urlqote

diff --git a/cubicweb_openidrelay/utils.py b/cubicweb_openidrelay/utils.py
--- a/cubicweb_openidrelay/utils.py
+++ b/cubicweb_openidrelay/utils.py
@@ -9,9 +9,8 @@
 import threading
 
 def url_args(url):
-    from urllib import unquote
-    import urlparse
-    args = urlparse.urlsplit(url)[3]
+    from urllib.parse import unquote, urlsplit
+    args = urlsplit(url)[3]
     args = dict((unquote(k), unquote(v))
                 for k, v in (arg.split('=')
                              for arg in args.split('&')))




More information about the cubicweb-devel mailing list