Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pyromancer/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import time

from pyromancer import utils
import collections


class Pyromancer(object):
Expand Down Expand Up @@ -418,7 +419,7 @@ def __init__(self, scheduled, msg_or_command=None, *args, **kwargs):
self.msg_tuple = None
self.function = None

if callable(msg_or_command):
if isinstance(msg_or_command, collections.Callable):
self.function = msg_or_command
else:
if target is not None and msg_or_command is not None:
Expand Down
2 changes: 1 addition & 1 deletion pyromancer/test/mock_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class MockObject(object):

def __init__(self, **kwargs):
for key, val in kwargs.items():
for key, val in list(kwargs.items()):
setattr(self, key, val)


Expand Down
3 changes: 2 additions & 1 deletion pyromancer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import importlib
import inspect
from types import GeneratorType
import collections


def find_functions(packages, into, submodule, ignored=None,
Expand Down Expand Up @@ -61,7 +62,7 @@ def process_messages(result, with_target=False):
msg = msg[1:]
timer = True

if callable(msg[0]):
if isinstance(msg[0], collections.Callable):
get_target = False
target = None
else:
Expand Down