Skip to content

Commit

Permalink
Added compatibility for python2 in replyToWrapper.
Browse files Browse the repository at this point in the history
  • Loading branch information
oriol committed Jun 26, 2018
1 parent c04075f commit 3bf270c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nxsugarpy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,4 +327,4 @@ def getConfig():
if err != None:
logWithFields(ErrorLevel, "config", errM, err)
return None, err
return _config, None
return _config, None
3 changes: 2 additions & 1 deletion nxsugarpy/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from nxsugarpy.helpers import *
from nxsugarpy.stats import *
from nxsugarpy.signal import *
from six import string_types

import time
import threading
Expand Down Expand Up @@ -688,7 +689,7 @@ def replyToWrapper(f):
def wrapped(task):
if isinstance(task.params, dict) and "replyTo" in task.params and isinstance(task.params["replyTo"], dict):
replyTo = task.params["replyTo"]
if "path" in replyTo and isinstance(replyTo["path"], str) and "type" in replyTo and isinstance(replyTo["type"], str) and replyTo["type"] in ["pipe", "service"]:
if "path" in replyTo and isinstance(replyTo["path"], string_types) and "type" in replyTo and isinstance(replyTo["type"], string_types) and replyTo["type"] in ["pipe", "service"]:
res, errm = f(task)
task.tags["@local-repliedTo"] = True
_, err = task.accept()
Expand Down

0 comments on commit 3bf270c

Please sign in to comment.