Skip to content

Commit 65a252a

Browse files
committed
fix(Lib/path): fixup(725daf4): WindowsPath.name deadloop
1 parent b528d0f commit 65a252a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎npython/builtinModules/pathlib/meth/props.nim‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,10 @@ proc getPathName(str: string, sep: char, start=0): string =
5454
let idx = str.rfind(sep, start)
5555
if idx < 0: return str[start..^1]
5656
str[idx + 1 .. ^1]
57-
method name*(self): string {.base, raises: [].} = self.str.getPathName self.getSep()
57+
proc getNameBase(self): string {.base, raises: [].} = self.str.getPathName self.getSep()
58+
method name*(self): string {.base, raises: [].} = self.getNameBase
5859
proc getWinName*(self: PyPurePathObject): string {.raises: [].} =
59-
if not self.str.startsWith("//"): return self.name
60+
if not self.str.startsWith("//"): return self.getNameBase
6061
if self.str.len == 2: return # '//'
6162

6263
# skip srv name

0 commit comments

Comments
 (0)