|
57 | 57 | from dohq_artifactory.compat import IS_PYTHON_3_10_OR_NEWER |
58 | 58 | from dohq_artifactory.compat import IS_PYTHON_3_12_OR_NEWER |
59 | 59 | from dohq_artifactory.compat import IS_PYTHON_3_13_OR_NEWER |
| 60 | +from dohq_artifactory.compat import IS_PYTHON_3_14_OR_NEWER |
60 | 61 | from dohq_artifactory.exception import ArtifactoryException |
61 | 62 | from dohq_artifactory.exception import raise_for_status |
62 | 63 | from dohq_artifactory.logger import logger |
@@ -1499,28 +1500,28 @@ class ArtifactoryOpensourceAccessor(_ArtifactoryAccessor): |
1499 | 1500 |
|
1500 | 1501 |
|
1501 | 1502 | # In Python 3.13, pathlib now reuses code from the glob package in order to implement |
1502 | | -# the Path.glob() method. There are two related classes in the glob package, _Globber |
| 1503 | +# the Path.glob() method. There are two related classes in the glob package, _GlobberBase |
1503 | 1504 | # and _StringGlobber, where the former will delegate operations to the Path object while |
1504 | 1505 | # the latter directly calls os.path functions, performing actual file system calls. The |
1505 | 1506 | # private abstract base class of PurePath, PurePathBase, sets the _globber class |
1506 | | -# attribute to _Globber, while PurePath overrides it to be _StringGlobber. |
| 1507 | +# attribute to _GlobberBase, while PurePath overrides it to be _StringGlobber. |
1507 | 1508 | # |
1508 | | -# We create a custom subclass that explicitly subclasses _Globber and not |
| 1509 | +# We create a custom subclass that explicitly subclasses _GlobberBase and not |
1509 | 1510 | # _StringGlobber, since we want the version that delegates file system operations to the |
1510 | 1511 | # Path objects. |
1511 | 1512 | # |
1512 | | -# In addition, we override _Globber.recursive_selector() with a copy of the original |
| 1513 | +# In addition, we override _GlobberBase.recursive_selector() with a copy of the original |
1513 | 1514 | # code but with one modification. Inside the definition of the nested select_recursive() |
1514 | 1515 | # function, we # add 1 to the original value of match_pos. The reason for this is that |
1515 | 1516 | # the add_slash() method will not actually add a slash when the path object is an |
1516 | 1517 | # instance of a Path subclass, since it will normally get normalized away. The match |
1517 | 1518 | # position therefore needs to be incremented by 1 in order to account for the actual |
1518 | 1519 | # slash character that appears when inspecting children of the current directory. This |
1519 | | -# isn't an issue in the actual use of _Globber in Python, since it converts all paths to |
| 1520 | +# isn't an issue in the actual use of _GlobberBase in Python, since it converts all paths to |
1520 | 1521 | # strings, and the add_slash() will literally append a slash character to the string |
1521 | 1522 | # path. See the original code in |
1522 | | -# https://github.com/python/cpython/blob/v3.13.2/Lib/glob.py#L448-L510 |
1523 | | -class _ArtifactoryGlobber(glob._Globber if IS_PYTHON_3_13_OR_NEWER else object): |
| 1523 | +# https://github.com/python/cpython/blob/v3.14.0/Lib/glob.py#L445-L505 |
| 1524 | +class _ArtifactoryGlobber(glob._GlobberBase if IS_PYTHON_3_14_OR_NEWER else glob._Globber if IS_PYTHON_3_13_OR_NEWER else object): |
1524 | 1525 | def recursive_selector(self, part, parts): |
1525 | 1526 | """Returns a function that selects a given path and all its children, |
1526 | 1527 | recursively, filtering by pattern. |
|
0 commit comments