summaryrefslogtreecommitdiff
path: root/tests/echo3.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/echo3.py')
-rw-r--r--tests/echo3.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/echo3.py b/tests/echo3.py
index 0644967..a009ea3 100644
--- a/tests/echo3.py
+++ b/tests/echo3.py
@@ -1,4 +1,12 @@
import os
+import sys
+
+asyncio_path = os.path.join(os.path.dirname(__file__), '..')
+asyncio_path = os.path.abspath(asyncio_path)
+
+sys.path.insert(0, asyncio_path)
+from trollius.py33_exceptions import wrap_error
+sys.path.remove(asyncio_path)
if __name__ == '__main__':
while True:
@@ -6,6 +14,6 @@ if __name__ == '__main__':
if not buf:
break
try:
- os.write(1, b'OUT:'+buf)
+ wrap_error(os.write, 1, b'OUT:'+buf)
except OSError as ex:
os.write(2, b'ERR:' + ex.__class__.__name__.encode('ascii'))