Skip to content

Commit 9a94e48

Browse files
committed
cache path cwd
1 parent 6663dfd commit 9a94e48

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

reflex/utils/prerequisites.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,11 @@ def _check_app_name(config: Config):
167167
config._app_name_is_valid = True
168168

169169

170+
@once
171+
def _cwd():
172+
return str(Path.cwd())
173+
174+
170175
def get_app(reload: bool = False) -> ModuleType:
171176
"""Get the app module based on the default config.
172177
@@ -189,7 +194,7 @@ def get_app(reload: bool = False) -> ModuleType:
189194
_check_app_name(config)
190195

191196
module = config.module
192-
sys.path.insert(0, str(Path.cwd()))
197+
sys.path.insert(0, _cwd())
193198
app = (
194199
__import__(module, fromlist=(constants.CompileVars.APP,))
195200
if not config.app_module

0 commit comments

Comments
 (0)