From fde10f5395993179be0833ff6c26ac4af74eae98 Mon Sep 17 00:00:00 2001 From: Simon Ebner Date: Sat, 23 Oct 2021 12:25:09 +0200 Subject: [PATCH] Use pathlib.stem instead of str(x).ends_with --- freqtrade/resolvers/iresolver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/freqtrade/resolvers/iresolver.py b/freqtrade/resolvers/iresolver.py index 2cccec70a..c6f97c976 100644 --- a/freqtrade/resolvers/iresolver.py +++ b/freqtrade/resolvers/iresolver.py @@ -91,7 +91,7 @@ class IResolver: logger.debug(f"Searching for {cls.object_type.__name__} {object_name} in '{directory}'") for entry in directory.iterdir(): # Only consider python files - if not str(entry).endswith('.py'): + if entry.suffix != '.py': logger.debug('Ignoring %s', entry) continue if entry.is_symlink() and not entry.is_file(): @@ -169,7 +169,7 @@ class IResolver: objects = [] for entry in directory.iterdir(): # Only consider python files - if not str(entry).endswith('.py'): + if entry.suffix != '.py': logger.debug('Ignoring %s', entry) continue module_path = entry.resolve()