diff --git a/src/BasicUtils/_UpdateCallback.py b/src/BasicUtils/_UpdateCallback.py index c7780caa4..95befebfa 100644 --- a/src/BasicUtils/_UpdateCallback.py +++ b/src/BasicUtils/_UpdateCallback.py @@ -53,7 +53,7 @@ class UpdateCallback: @param interval: number of seconds at most between the updates @type interval: int """ - if '__call__' in dir(callback): # callback is really callable + if callable(callback): # callback is really callable self.update = self.update_real self.callback = callback self.interval = interval diff --git a/src/plugins/ExportCSV.py b/src/plugins/ExportCSV.py index 32173356c..2e8494eea 100644 --- a/src/plugins/ExportCSV.py +++ b/src/plugins/ExportCSV.py @@ -237,7 +237,7 @@ class CSVWriter: self.cl = cl self.filename = filename self.callback = callback - if '__call__' in dir(self.callback): # callback is really callable + if callable(self.callback): # callback is really callable self.update = self.update_real else: self.update = self.update_empty diff --git a/src/plugins/ExportVCalendar.py b/src/plugins/ExportVCalendar.py index b7939c4c6..c77c8539f 100644 --- a/src/plugins/ExportVCalendar.py +++ b/src/plugins/ExportVCalendar.py @@ -136,7 +136,7 @@ class CalendarWriter: self.cl = cl self.filename = filename self.callback = callback - if '__call__' in dir(self.callback): # callback is really callable + if callable(self.callback): # callback is really callable self.update = self.update_real else: self.update = self.update_empty diff --git a/src/plugins/ExportVCard.py b/src/plugins/ExportVCard.py index 4c9e24945..b76081c30 100644 --- a/src/plugins/ExportVCard.py +++ b/src/plugins/ExportVCard.py @@ -133,7 +133,7 @@ class CardWriter: self.cl = cl self.filename = filename self.callback = callback - if '__call__' in dir(self.callback): # callback is really callable + if callable(self.callback): # callback is really callable self.update = self.update_real else: self.update = self.update_empty diff --git a/src/plugins/WriteFtree.py b/src/plugins/WriteFtree.py index 111655a94..f1155bee7 100644 --- a/src/plugins/WriteFtree.py +++ b/src/plugins/WriteFtree.py @@ -141,7 +141,7 @@ class FtreeWriter: self.cl = cl self.filename = filename self.callback = callback - if '__call__' in dir(self.callback): # callback is really callable + if callable(self.callback): # callback is really callable self.update = self.update_real else: self.update = self.update_empty diff --git a/src/plugins/WriteGeneWeb.py b/src/plugins/WriteGeneWeb.py index 7587f04fe..a697f4f72 100644 --- a/src/plugins/WriteGeneWeb.py +++ b/src/plugins/WriteGeneWeb.py @@ -162,7 +162,7 @@ class GeneWebWriter: self.cl = cl self.filename = filename self.callback = callback - if '__call__' in dir(self.callback): # callback is really callable + if callable(self.callback): # callback is really callable self.update = self.update_real else: self.update = self.update_empty