From 01af31d2dd28ca959866933ae2927b6feaac66e6 Mon Sep 17 00:00:00 2001 From: Damjan Dimitrioski Date: Tue, 21 Sep 2021 11:49:58 +0200 Subject: [PATCH] Patch for python 3.8 on GNU/Linux environment aka PosixPath --- livereload/watcher.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/livereload/watcher.py b/livereload/watcher.py index bfb2d8f..bdfa3d2 100644 --- a/livereload/watcher.py +++ b/livereload/watcher.py @@ -138,9 +138,17 @@ def is_folder_changed(self, path, ignore=None): return False def is_glob_changed(self, path, ignore=None): - for f in glob.glob(path): - if self.is_file_changed(f, ignore): - return True + try: + for f in glob.glob(path): + if self.is_file_changed(f, ignore): + return True + except TypeError: + """ + Problem: on every ~10 times for some reason the glob returns Path instead of a string + TODO: Rewrite this block to use the python Path alongside string + aka pathlib introduced in Python 3.4 + """ + return False