diff --git a/alembic/script/base.py b/alembic/script/base.py index d0f9abbd..7930fe14 100644 --- a/alembic/script/base.py +++ b/alembic/script/base.py @@ -212,9 +212,12 @@ def from_config(cls, config: Config) -> ScriptDirectory: prepend_sys_path = config.get_main_option("prepend_sys_path") if prepend_sys_path: - sys.path[:0] = list( - _split_on_space_comma_colon.split(prepend_sys_path) - ) + if os.name == 'nt': + prepend_paths = _split_on_space_comma.split(prepend_sys_path) + else: + prepend_paths = _split_on_space_comma_colon.split(prepend_sys_path) + + sys.path[:0] = (os.path.normpath(path.strip()) for path in prepend_paths) rvl = config.get_main_option("recursive_version_locations") == "true" return ScriptDirectory(