eric6/eric6_post_install.py

changeset 8243
cc717c2ae956
parent 7960
e8fc383322f7
child 8661
1dc0a266d5f5
--- a/eric6/eric6_post_install.py	Thu Apr 15 16:52:05 2021 +0200
+++ b/eric6/eric6_post_install.py	Thu Apr 15 18:11:24 2021 +0200
@@ -12,6 +12,7 @@
 import os
 import shutil
 import sysconfig
+import contextlib
 
 ######################################################################
 ## Post installation hooks for Windows below
@@ -120,16 +121,13 @@
     from win32com.client import Dispatch
     from pywintypes import com_error
     
-    try:
+    with contextlib.suppress(com_error):
         shell = Dispatch('WScript.Shell')
         shortcut = shell.CreateShortCut(linkPath)
         shortcut.Targetpath = targetPath
         shortcut.WorkingDirectory = os.path.dirname(targetPath)
         shortcut.IconLocation = iconPath
         shortcut.save()
-    except com_error:
-        # maybe restrictions prohibited link creation
-        pass
 
 
 def windowsProgramsEntry():

eric ide

mercurial