eric6/PluginManager/PluginInstallDialog.py

changeset 8240
93b8a353c4bf
parent 8220
006ee31b4835
child 8243
cc717c2ae956
diff -r 59a9a658618c -r 93b8a353c4bf eric6/PluginManager/PluginInstallDialog.py
--- a/eric6/PluginManager/PluginInstallDialog.py	Wed Apr 14 19:38:19 2021 +0200
+++ b/eric6/PluginManager/PluginInstallDialog.py	Wed Apr 14 19:59:16 2021 +0200
@@ -13,10 +13,8 @@
 import zipfile
 import compileall
 import glob
-try:  # Py3
-    import urllib.parse as parse
-except (ImportError):
-    import urlparse as parse    # __IGNORE_WARNING__
+import contextlib
+import urllib.parse
 
 from PyQt5.QtCore import pyqtSlot, Qt, QDir, QFileInfo
 from PyQt5.QtWidgets import (
@@ -267,7 +265,7 @@
             self.destinationCombo.currentIndex())
         
         # check if archive is a local url
-        url = parse.urlparse(archive)
+        url = urllib.parse.urlparse(archive)
         if url[0].lower() == 'file':
             archive = url[2]
 
@@ -351,10 +349,8 @@
                 needsRestart = tokens[1].strip() == "True"
             elif line.startswith("pyqtApi"):
                 tokens = line.split("=")
-                try:
+                with contextlib.suppress(ValueError):
                     pyqtApi = int(tokens[1].strip())
-                except ValueError:
-                    pass
             elif line.startswith("doNotCompile"):
                 tokens = line.split("=")
                 if tokens[1].strip() == "True":

eric ide

mercurial