Skip to content

Commit

Permalink
fix issue with support for python 3.7 and lower
Browse files Browse the repository at this point in the history
  • Loading branch information
liormizr committed Nov 17, 2022
1 parent b5525a6 commit 56798ac
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions s3path.py
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,8 @@ def glob(self, pattern):

def _glob(self, pattern):
""" Glob with new Algorithm that better fit S3 API """
sys.audit("pathlib.Path.glob", self, pattern)
if StrictVersion(python_version()) >= StrictVersion('3.8'):
sys.audit("pathlib.Path.glob", self, pattern)
if not pattern:
raise ValueError("Unacceptable pattern: {!r}".format(pattern))
drv, root, pattern_parts = self._flavour.parse_parts((pattern,))
Expand All @@ -930,7 +931,8 @@ def rglob(self, pattern):

def _rglob(self, pattern):
""" RGlob with new Algorithm that better fit S3 API """
sys.audit("pathlib.Path.rglob", self, pattern)
if StrictVersion(python_version()) >= StrictVersion('3.8'):
sys.audit("pathlib.Path.rglob", self, pattern)
if not pattern:
raise ValueError("Unacceptable pattern: {!r}".format(pattern))
drv, root, pattern_parts = self._flavour.parse_parts((pattern,))
Expand Down

0 comments on commit 56798ac

Please sign in to comment.