Compare commits

...
2 Commits
Author SHA1 Message Date
arcanis a11fd188a2 Release 2.0.0rc11 2022-05-10 06:03:33 +03:00
arcanis 2431d5de0e fix bug with checking file
The bug appear when the file exists or doesn't, but we don't have
permissions to read it. This one must be treated as missed permission
2022-05-10 06:01:41 +03:00
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
# Maintainer: Evgeniy Alekseev # Maintainer: Evgeniy Alekseev
pkgname='ahriman' pkgname='ahriman'
pkgver=2.0.0rc10 pkgver=2.0.0rc11
pkgrel=1 pkgrel=1
pkgdesc="ArcH Linux ReposItory MANager" pkgdesc="ArcH Linux ReposItory MANager"
arch=('any') arch=('any')
+3 -1
View File
@@ -19,6 +19,7 @@
# #
import importlib import importlib
import logging import logging
import os
from pathlib import Path from pathlib import Path
from types import ModuleType from types import ModuleType
@@ -123,7 +124,8 @@ class TriggerLoader:
*package_path_parts, class_name = module_path.split(".") *package_path_parts, class_name = module_path.split(".")
package_or_path = ".".join(package_path_parts) package_or_path = ".".join(package_path_parts)
if Path(package_or_path).is_file(): # it works for both missing permission and file does not exist
if os.access(Path(package_or_path), os.R_OK):
module = self._load_module_from_file(package_or_path, class_name) module = self._load_module_from_file(package_or_path, class_name)
else: else:
module = self._load_module_from_package(package_or_path) module = self._load_module_from_package(package_or_path)
+1 -1
View File
@@ -17,4 +17,4 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
__version__ = "2.0.0rc10" __version__ = "2.0.0rc11"