From 8c7bebb8655b280874ebc1da8baea48cb5750afb Mon Sep 17 00:00:00 2001 From: romulosouza Date: Tue, 10 Nov 2020 11:32:34 -0300 Subject: [PATCH] Remove unnecessary casting --- rasa/nlu/utils/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rasa/nlu/utils/__init__.py b/rasa/nlu/utils/__init__.py index b0c15a70dd14..942cf2b0accc 100644 --- a/rasa/nlu/utils/__init__.py +++ b/rasa/nlu/utils/__init__.py @@ -43,8 +43,8 @@ def is_model_dir(model_dir: Text) -> bool: if any([d.is_dir() for d in dir_tree.iterdir()]): # look for subdirectories return False - file_extenstions = [PurePath(f).suffix for f in list(dir_tree.iterdir())] - only_valid_files = all([ext in allowed_extensions for ext in file_extenstions]) + file_extensions = [PurePath(f).suffix for f in dir_tree.iterdir()] + only_valid_files = all([ext in allowed_extensions for ext in file_extensions]) return only_valid_files