Skip to content

Commit bb017d7

Browse files
committed
fix bug multiple stdin in same check
1 parent ad90d0d commit bb017d7

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

checkpy/caches.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def cachedFuncWrapper(*args, **kwargs):
4040
key = str(args) + str(kwargs) + str(sys.argv)
4141
if key not in localCache:
4242
localCache[key] = func(*args, **kwargs)
43+
4344
return localCache[key]
4445
return cachedFuncWrapper
4546

checkpy/lib/basic.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@ def _getModuleAndOutputOf(
157157
excep = None
158158

159159
with checkpy.lib.io.captureStdout() as stdoutListener:
160+
161+
# flush stdin
162+
sys.stdin.seek(0)
163+
sys.stdin.flush()
164+
160165
# fill stdin with args
161166
if stdinArgs:
162167
for arg in stdinArgs:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
setup(
1212
name='checkPy',
1313

14-
version='2.1.1',
14+
version='2.1.2',
1515

1616
description='A simple python testing framework for educational purposes',
1717
long_description=long_description,

0 commit comments

Comments
 (0)