Skip to content

Commit feaf8a9

Browse files
committed
things continued to not help
1 parent 78a031c commit feaf8a9

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,13 @@ PythonShell.prototype.send = function (message) {
191191
return this;
192192
};
193193

194+
PythonShell.prototype.pauseInput = function (message) {
195+
this.stdin.pause();
196+
return this;
197+
};
198+
194199
PythonShell.prototype.flushInput = function (message) {
195-
this.stdin.write(os.EOL);
200+
// this.stdin.write(os.EOL);
196201
return this;
197202
};
198203

test/python/conversation.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,9 @@ def handleLine(line):
6565
response = handleLine(line)
6666

6767
print json.dumps(response)
68+
# print json.dumps({
69+
# 'action':'knockknockjoke',
70+
# 'message': "Who's there?"
71+
# })
6872
sys.stdout.flush()
69-
time.sleep(1)
73+
# time.sleep(1)

test/test-python-shell.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ describe('PythonShell', function () {
145145
done(util.format("Unexpected action: '%s'", data.action))
146146
}
147147
});
148+
149+
pyshell.stdout.resume();
148150
// }
149151

150152
// function awaitReply() {
@@ -163,6 +165,10 @@ describe('PythonShell', function () {
163165
// });
164166
// }
165167

168+
pyshell.stderr.on('data', function(err) {
169+
console.error(err);
170+
});
171+
166172
pyshell.on('close', function(err) {
167173
if (err) {
168174
return done(err);
@@ -175,8 +181,8 @@ describe('PythonShell', function () {
175181

176182
function flushStdIn() {
177183
// pyshell.stdin.write(os.EOF);
178-
// pyshell.pauseInput();
179-
pyshell.flushInput();
184+
pyshell.pauseInput();
185+
// pyshell.flushInput();
180186
}
181187

182188
function endAndAssert() {

0 commit comments

Comments
 (0)