mirror of
https://github.com/GothenburgBitFactory/task-timewarrior-hook.git
synced 2025-06-26 10:54:27 +02:00
Make hook run in both python 2 and 3
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
parent
4af061abda
commit
f375654523
1 changed files with 7 additions and 2 deletions
|
@ -38,9 +38,14 @@ import subprocess
|
|||
# Description
|
||||
# UDAs
|
||||
|
||||
try:
|
||||
input_stream = sys.stdin.buffer
|
||||
except AttributeError:
|
||||
input_stream = sys.stdin
|
||||
|
||||
# Make no changes to the task, simply observe.
|
||||
old = json.loads(sys.stdin.buffer.readline().decode("utf-8", errors="replace"))
|
||||
new = json.loads(sys.stdin.buffer.readline().decode("utf-8", errors="replace"))
|
||||
old = json.loads(input_stream.readline().decode("utf-8", errors="replace"))
|
||||
new = json.loads(input_stream.readline().decode("utf-8", errors="replace"))
|
||||
print(json.dumps(new))
|
||||
|
||||
def extract_timew_tags_from(json_obj):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue