Skip to content

Commit

Permalink
fix: MyPy error when mod.__file__ is None
Browse files Browse the repository at this point in the history
  • Loading branch information
iisakkirotko committed Sep 15, 2023
1 parent c34562f commit b43cb17
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions solara/server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ def __init__(self, name, default_app_name="Page"):
if self.type == AppType.MODULE:
package_name = self.name.split(".")[0]
mod = importlib.import_module(package_name)
package_root_path = Path(mod.__file__).parent
reload.reloader.root_path = package_root_path
if mod.__file__ is not None:
package_root_path = Path(mod.__file__).parent
reload.reloader.root_path = package_root_path
app_context.close()

def _execute(self):
Expand Down

0 comments on commit b43cb17

Please sign in to comment.