[nautilus-python/wip/jtojnar/nautilus-4: 2/4] Remove Python 2 urllib remnants




commit c2080e02039d261d5f5e905f99a19dd4c2cb5796
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.

 docs/reference/nautilus-python-column-provider.xml        | 7 +------
 docs/reference/nautilus-python-property-page-provider.xml | 7 +------
 examples/block-size-column.py                             | 7 +------
 examples/md5sum-property-page.py                          | 7 +------
 examples/open-terminal.py                                 | 7 +------
 5 files changed, 5 insertions(+), 30 deletions(-)
---
diff --git a/docs/reference/nautilus-python-column-provider.xml 
b/docs/reference/nautilus-python-column-provider.xml
index 8adf2e3..bf2dd20 100644
--- a/docs/reference/nautilus-python-column-provider.xml
+++ b/docs/reference/nautilus-python-column-provider.xml
@@ -47,12 +47,7 @@
     <programlisting>
 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/docs/reference/nautilus-python-property-page-provider.xml 
b/docs/reference/nautilus-python-property-page-provider.xml
index 2afa2f9..20f0031 100644
--- a/docs/reference/nautilus-python-property-page-provider.xml
+++ b/docs/reference/nautilus-python-property-page-provider.xml
@@ -42,12 +42,7 @@
     <programlisting>
 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/block-size-column.py b/examples/block-size-column.py
index e481dff..117d430 100644
--- a/examples/block-size-column.py
+++ b/examples/block-size-column.py
@@ -1,11 +1,6 @@
 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..60804b4 100644
--- a/examples/md5sum-property-page.py
+++ b/examples/md5sum-property-page.py
@@ -1,11 +1,6 @@
 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 33ac5f1..9ec8c39 100644
--- a/examples/open-terminal.py
+++ b/examples/open-terminal.py
@@ -1,12 +1,7 @@
 # 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
 from gi.repository import Nautilus, GObject
 
 


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