Skip to content

Commit b9e7333

Browse files
committed
Use os.path.normpath
1 parent 0f8482a commit b9e7333

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

flit_core/flit_core/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,12 +603,12 @@ def read_pep621_metadata(proj, path) -> LoadedConfig:
603603
raise ConfigError(
604604
"[project.license] should specify file or text, not both"
605605
)
606-
license_f = license_tbl['file']
606+
license_f = osp.normpath(license_tbl['file'])
607607
if isabs_ish(license_f):
608608
raise ConfigError(
609609
f"License file path ({license_f}) cannot be an absolute path"
610610
)
611-
if ".." in license_f:
611+
if license_f.startswith('..' + os.sep):
612612
raise ConfigError(
613613
f"License file path ({license_f}) cannot contain '..'"
614614
)

0 commit comments

Comments
 (0)