eric6/PluginManager/PluginManager.py

branch
maintenance
changeset 7968
e3d251e74f2d
parent 7924
8a96736d465e
child 8043
0acf98cd089a
--- a/eric6/PluginManager/PluginManager.py	Thu Jan 07 17:22:16 2021 +0100
+++ b/eric6/PluginManager/PluginManager.py	Mon Jan 11 19:31:21 2021 +0100
@@ -224,21 +224,19 @@
             except OSError:
                 del self.pluginDirs["user"]
         
-        if (
-            not os.path.exists(self.pluginDirs["global"]) and
-            os.access(Utilities.getPythonModulesDirectory(), os.W_OK)
-        ):
-            # create the global plugins directory
-            os.mkdir(self.pluginDirs["global"], 0o755)
-            fname = os.path.join(self.pluginDirs["global"], "__init__.py")
-            with open(fname, "w", encoding="utf-8") as f:
-                f.write('# -*- coding: utf-8 -*-' + "\n")
-                f.write("\n")
-                f.write('"""' + "\n")
-                f.write('Package containing the global plugins.' + "\n")
-                f.write('"""' + "\n")
         if not os.path.exists(self.pluginDirs["global"]):
-            del self.pluginDirs["global"]
+            try:
+                # create the global plugins directory
+                os.mkdir(self.pluginDirs["global"], 0o755)
+                fname = os.path.join(self.pluginDirs["global"], "__init__.py")
+                with open(fname, "w", encoding="utf-8") as f:
+                    f.write('# -*- coding: utf-8 -*-' + "\n")
+                    f.write("\n")
+                    f.write('"""' + "\n")
+                    f.write('Package containing the global plugins.' + "\n")
+                    f.write('"""' + "\n")
+            except OSError:
+                del self.pluginDirs["global"]
         
         if not os.path.exists(self.pluginDirs["eric6"]):
             return (

eric ide

mercurial