diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-07-05 16:32:38 +0200 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-07-05 16:32:38 +0200 |
commit | 9dd38bd840c3a4573d5ecdb9d6db27e6ff729338 (patch) | |
tree | 00211bced3a7d6c2301d8eb5e88d6f5ae2545aa7 | |
parent | fcaaa6ef492282bccf60fccbd74e1f493c6a0ccf (diff) | |
download | poezio-9dd38bd840c3a4573d5ecdb9d6db27e6ff729338.tar.gz poezio-9dd38bd840c3a4573d5ecdb9d6db27e6ff729338.tar.bz2 poezio-9dd38bd840c3a4573d5ecdb9d6db27e6ff729338.tar.xz poezio-9dd38bd840c3a4573d5ecdb9d6db27e6ff729338.zip |
Add a few more str() on pathlib.Path objects.
-rw-r--r-- | poezio/plugin_manager.py | 10 |
1 files 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 |