Backports the relevant bits of 0f77b6e66f
This commit is contained in:
parent
7cec6476c7
commit
d274769761
6
lib/spack/external/py/_path/local.py
vendored
6
lib/spack/external/py/_path/local.py
vendored
@ -10,7 +10,7 @@
|
|||||||
from py._path.common import iswin32, fspath
|
from py._path.common import iswin32, fspath
|
||||||
from stat import S_ISLNK, S_ISDIR, S_ISREG
|
from stat import S_ISLNK, S_ISDIR, S_ISREG
|
||||||
|
|
||||||
from os.path import abspath, normcase, normpath, isabs, exists, isdir, isfile, islink, dirname
|
from os.path import abspath, normpath, isabs, exists, isdir, isfile, islink, dirname
|
||||||
|
|
||||||
if sys.version_info > (3,0):
|
if sys.version_info > (3,0):
|
||||||
def map_as_list(func, iter):
|
def map_as_list(func, iter):
|
||||||
@ -801,10 +801,10 @@ def make_numbered_dir(cls, prefix='session-', rootdir=None, keep=3,
|
|||||||
if rootdir is None:
|
if rootdir is None:
|
||||||
rootdir = cls.get_temproot()
|
rootdir = cls.get_temproot()
|
||||||
|
|
||||||
nprefix = normcase(prefix)
|
nprefix = prefix.lower()
|
||||||
def parse_num(path):
|
def parse_num(path):
|
||||||
""" parse the number out of a path (if it matches the prefix) """
|
""" parse the number out of a path (if it matches the prefix) """
|
||||||
nbasename = normcase(path.basename)
|
nbasename = path.basename.lower()
|
||||||
if nbasename.startswith(nprefix):
|
if nbasename.startswith(nprefix):
|
||||||
try:
|
try:
|
||||||
return int(nbasename[len(nprefix):])
|
return int(nbasename[len(nprefix):])
|
||||||
|
Loading…
Reference in New Issue
Block a user