[nautilus-python] Remove Python 2 urllib remnants



commit 38e7b3dd45bfd329bb8b1ce3ac69a760990b91e6
Author: Jan Tojnar <jtojnar gmail com>
Date:   Wed Aug 10 22:37:28 2022 +0200

    Remove Python 2 urllib remnants
    
    In Python 3 urllib was split into multiple libraries,
    we do not need to support the Python 2 variant any longer.

 examples/block-size-column.py    | 8 +-------
 examples/md5sum-property-page.py | 8 +-------
 examples/open-terminal.py        | 8 +-------
 3 files changed, 3 insertions(+), 21 deletions(-)
---
diff --git a/examples/block-size-column.py b/examples/block-size-column.py
index e481dff..b87dada 100644
--- a/examples/block-size-column.py
+++ b/examples/block-size-column.py
@@ -1,11 +1,5 @@
 import os
-
-# A way to get unquote working with python 2 and 3
-try:
-    from urllib import unquote
-except ImportError:
-    from urllib.parse import unquote
-
+from urllib.parse import unquote
 from gi.repository import GObject, Nautilus
 
 class ColumnExtension(GObject.GObject, Nautilus.ColumnProvider, Nautilus.InfoProvider):
diff --git a/examples/md5sum-property-page.py b/examples/md5sum-property-page.py
index 42e1df7..1beb469 100644
--- a/examples/md5sum-property-page.py
+++ b/examples/md5sum-property-page.py
@@ -1,11 +1,5 @@
 import hashlib
-
-# A way to get unquote working with python 2 and 3
-try:
-    from urllib import unquote
-except ImportError:
-    from urllib.parse import unquote
-
+from urllib.parse import unquote
 from gi.repository import Nautilus, Gtk, GObject
 
 class MD5SumPropertyPage(GObject.GObject, Nautilus.PropertyPageProvider):
diff --git a/examples/open-terminal.py b/examples/open-terminal.py
index 8d33733..fd43d85 100644
--- a/examples/open-terminal.py
+++ b/examples/open-terminal.py
@@ -1,12 +1,6 @@
 # This example is contributed by Martin Enlund
 import os
-
-# A way to get unquote working with python 2 and 3
-try:
-    from urllib import unquote
-except ImportError:
-    from urllib.parse import unquote
-
+from urllib.parse import unquote
 import gi
 gi.require_version('GConf', '2.0')
 from gi.repository import Nautilus, GObject, GConf


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]