storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject [1/3] git commit: change bug of readMsg
Date Thu, 10 Jul 2014 13:07:40 GMT
Repository: incubator-storm
Updated Branches:
  refs/heads/master 8da9572ac -> 1471cbd49


change bug of readMsg


Project: http://git-wip-us.apache.org/repos/asf/incubator-storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-storm/commit/7ce0bff2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-storm/tree/7ce0bff2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-storm/diff/7ce0bff2

Branch: refs/heads/master
Commit: 7ce0bff2ca63c830e148385b4cce231152843d58
Parents: 2a60e99
Author: JuDasheng <judasheng@meituan.com>
Authored: Fri Jun 13 12:12:54 2014 +0800
Committer: JuDasheng <judasheng@meituan.com>
Committed: Fri Jun 13 12:12:54 2014 +0800

----------------------------------------------------------------------
 storm-core/src/multilang/py/storm.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/7ce0bff2/storm-core/src/multilang/py/storm.py
----------------------------------------------------------------------
diff --git a/storm-core/src/multilang/py/storm.py b/storm-core/src/multilang/py/storm.py
index bec3f0c..fcb06e2 100755
--- a/storm-core/src/multilang/py/storm.py
+++ b/storm-core/src/multilang/py/storm.py
@@ -33,10 +33,12 @@ json_decode = lambda x: json.loads(x)
 def readMsg():
     msg = ""
     while True:
-        line = sys.stdin.readline()[0:-1]
-        if line == "end":
+        line = sys.stdin.readline()
+        if not line:
+            raise Exception('Read EOF from stdin')
+        if line[0:-1] == "end":
             break
-        msg = msg + line + "\n"
+        msg = msg + line
     return json_decode(msg[0:-1])
 
 MODE = None


Mime
View raw message