Skip to content

Commit d240cb3

Browse files
committed
use get cwd for maximum perf
1 parent 9a94e48 commit d240cb3

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

reflex/utils/prerequisites.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import sys
1313
import typing
1414
from datetime import datetime
15+
from os import getcwd
1516
from pathlib import Path
1617
from types import ModuleType
1718
from typing import NamedTuple
@@ -167,11 +168,6 @@ def _check_app_name(config: Config):
167168
config._app_name_is_valid = True
168169

169170

170-
@once
171-
def _cwd():
172-
return str(Path.cwd())
173-
174-
175171
def get_app(reload: bool = False) -> ModuleType:
176172
"""Get the app module based on the default config.
177173
@@ -194,7 +190,7 @@ def get_app(reload: bool = False) -> ModuleType:
194190
_check_app_name(config)
195191

196192
module = config.module
197-
sys.path.insert(0, _cwd())
193+
sys.path.insert(0, getcwd()) # noqa: PTH109
198194
app = (
199195
__import__(module, fromlist=(constants.CompileVars.APP,))
200196
if not config.app_module

0 commit comments

Comments
 (0)