From fd8821d1c3c28625da93ac65b9f2f4baa12078db Mon Sep 17 00:00:00 2001 From: Juhani Simola Date: Sun, 13 Dec 2015 15:04:37 +0200 Subject: [PATCH] Fix iterable detection in WatchManager.__format_param In python3, dict.values() is not a list but dict_values, which breaks code like wm.rm_watch(wdd.values()) from tutorial. --- python3/pyinotify.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python3/pyinotify.py b/python3/pyinotify.py index bc24313..0bc88b9 100755 --- a/python3/pyinotify.py +++ b/python3/pyinotify.py @@ -65,6 +65,7 @@ def __init__(self, version): import logging import atexit from collections import deque +from collections import Iterable from datetime import datetime, timedelta import time import re @@ -2045,7 +2046,7 @@ def __format_param(self, param): @return: wrap param. @rtype: list of type(param) """ - if isinstance(param, list): + if isinstance(param, Iterable): for p_ in param: yield p_ else: