Skip to content

Commit

Permalink
ArtifactoryPath: Fix glob() in Python 3.11
Browse files Browse the repository at this point in the history
Python 3.11 replaced _accessor.scandir with _scandir.
Override _scandir to still use our implementation.
Should be a noop on older Python versions because they
didn't have _scandir at all.

Fixes: devopshq#396

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
  • Loading branch information
flichtenheld committed Jul 19, 2023
1 parent d28a64b commit 326d6f0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions artifactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -1659,6 +1659,12 @@ def rmdir(self):
"""
self._accessor.rmdir(self)

def _scandir(self):
"""
Override Path._scandir. Only required on Python >= 3.11
"""
return self._accessor.scandir(self)

def download_stats(self, pathobj=None):
"""
Item statistics record the number of times an item was downloaded, last download date and last downloader.
Expand Down

0 comments on commit 326d6f0

Please sign in to comment.