From 9dd38bd840c3a4573d5ecdb9d6db27e6ff729338 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Thu, 5 Jul 2018 16:32:38 +0200 Subject: Add a few more str() on pathlib.Path objects. --- poezio/plugin_manager.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/poezio/plugin_manager.py b/poezio/plugin_manager.py index 15f0db8a..e17718de 100644 --- a/poezio/plugin_manager.py +++ b/poezio/plugin_manager.py @@ -335,7 +335,7 @@ class PluginManager(object): Create the plugins config directory if it does not exist. Returns True on success, False on failure. """ - if not os.access(self.plugins_conf_dir, os.R_OK | os.X_OK): + if not os.access(str(self.plugins_conf_dir), os.R_OK | os.X_OK): try: self.plugins_conf_dir.mkdir(parents=True, exist_ok=True) except OSError: @@ -359,9 +359,9 @@ class PluginManager(object): Create the plugins directory if it does not exist. Returns True on success, False on failure. """ - if not os.access(self.plugins_dir, os.R_OK | os.X_OK): + if not os.access(str(self.plugins_dir), os.R_OK | os.X_OK): try: - os.makedirs(self.plugins_dir, exist_ok=True) + self.plugins_dir.mkdir(parents=True, exist_ok=True) except OSError: log.error( 'Unable to create the plugins dir: %s', @@ -383,8 +383,8 @@ class PluginManager(object): if os.access(default_plugin_path, os.R_OK | os.X_OK): self.load_path.insert(0, default_plugin_path) - if os.access(self.plugins_dir, os.R_OK | os.X_OK): - self.load_path.append(self.plugins_dir) + if os.access(str(self.plugins_dir), os.R_OK | os.X_OK): + self.load_path.append(str(self.plugins_dir)) try: import poezio_plugins -- cgit v1.2.3