From 3457f05ec0eb5a00ce6d1062ae7c3f595865381b Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 30 Nov 2020 01:04:03 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20Don't=20crash=20if=20a=20Scroll?= =?UTF-8?q?=20file=20isn't=20found?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 2 +- royalnet/scrolls/__init__.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b5e23867..70eac9cf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "royalnet" -version = "6.0.0a14" +version = "6.0.0a15" description = "A multipurpose bot and web framework" authors = ["Stefano Pigozzi "] license = "AGPL-3.0-or-later" diff --git a/royalnet/scrolls/__init__.py b/royalnet/scrolls/__init__.py index 0ef9e958..01491fc4 100644 --- a/royalnet/scrolls/__init__.py +++ b/royalnet/scrolls/__init__.py @@ -78,6 +78,8 @@ class Scroll: return cls.loaders[lext](namespace=namespace, file_path=file_path) except KeyError: raise InvalidFileType(f"Invalid extension: {lext}") + except FileNotFoundError: + return cls(namespace=namespace) @classmethod def _validate_key(cls, item: str):