From f5ca88c1f424ca3da0b9b512e6633b12f4e6a132 Mon Sep 17 00:00:00 2001 From: Chris Wood Date: Wed, 25 Jul 2018 14:57:18 -0400 Subject: [PATCH] Fix broken conditional statement Because sys.platform will never return "linux" on python2 -- only "linux2" -- this statement will always be False. Instead, use the startswith idiom to both provide the intended behavior and ensure future compatibility with python3. --- src/allmydata/frontends/magic_folder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/allmydata/frontends/magic_folder.py b/src/allmydata/frontends/magic_folder.py index ff9ea59dd..f8758f3b8 100644 --- a/src/allmydata/frontends/magic_folder.py +++ b/src/allmydata/frontends/magic_folder.py @@ -75,7 +75,7 @@ def _get_inotify_module(): from allmydata.windows import inotify elif runtime.platform.supportsINotify(): from twisted.internet import inotify - elif sys.platform != "linux": + elif not sys.platform.startswith("linux"): from allmydata.watchdog import inotify else: raise NotImplementedError("filesystem notification needed for Magic Folder is not supported.\n"