Skip to content

Commit 4737f5f

Browse files
committed
tebelorg#46 - fix run() on Windows environment
The run() function does not work correctly on Windows. The root cause is semi-colon is not approrpriate as delimiter to combine with exit 0 command (for retrieving error output without triggering exception). This fix uses ; for Linux and macOS and & as the delimiter in Windows environment. More details in tebelorg#46.
1 parent 34e44c8 commit 4737f5f

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# TagUI for Python
44

5-
[**Use Cases**](#use-cases) | [**API Reference**](#api-reference) | [**About & Credits**](#about--credits) | [**v1.9**](https://github.com/tebelorg/TagUI-Python/releases)
5+
[**Use Cases**](#use-cases) | [**API Reference**](#api-reference) | [**About & Credits**](#about--credits) | [**v1.10**](https://github.com/tebelorg/TagUI-Python/releases)
66

77
![TagUI for Python demo in Jupyter notebook](https://raw.githubusercontent.com/tebelorg/Tump/master/tagui_python.gif)
88

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='tagui',
5-
version='1.9.1',
5+
version='1.10.0',
66
py_modules=['tagui'],
77
author='Ken Soh',
88
author_email='[email protected]',

tagui.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""INTEGRATION ENGINE FOR TAGUI PYTHON PACKAGE ~ TEBEL.ORG"""
22
__author__ = 'Ken Soh <[email protected]>'
3-
__version__ = '1.9.1'
3+
__version__ = '1.10.0'
44

55
import subprocess
66
import os
@@ -1167,8 +1167,12 @@ def run(command_to_run = None):
11671167
return ''
11681168

11691169
else:
1170+
if platform.system() == 'Windows':
1171+
command_delimiter = ' & '
1172+
else:
1173+
command_delimiter = '; '
11701174
return _py23_decode(subprocess.check_output(
1171-
command_to_run + '; exit 0',
1175+
command_to_run + command_delimiter + 'exit 0',
11721176
stderr=subprocess.STDOUT,
11731177
shell=True))
11741178

0 commit comments

Comments
 (0)