aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gn3/commands.py3
-rw-r--r--gn3/computations/diff.py2
2 files changed, 3 insertions, 2 deletions
diff --git a/gn3/commands.py b/gn3/commands.py
index 0f526d8..7d42ced 100644
--- a/gn3/commands.py
+++ b/gn3/commands.py
@@ -6,6 +6,7 @@ from datetime import datetime
from typing import Dict
from typing import List
from typing import Optional
+from typing import Tuple
from uuid import uuid4
from redis.client import Redis # Used only in type hinting
@@ -74,7 +75,7 @@ Returns the name of the specific redis hash for the specific task.
return unique_id
-def run_cmd(cmd: str, success_codes: List = [0]) -> Dict:
+def run_cmd(cmd: str, success_codes: Tuple = (0,)) -> Dict:
"""Run CMD and return the CMD's status code and output as a dict"""
results = subprocess.run(cmd, capture_output=True, shell=True,
check=False)
diff --git a/gn3/computations/diff.py b/gn3/computations/diff.py
index 4bbc6cf..af02f7f 100644
--- a/gn3/computations/diff.py
+++ b/gn3/computations/diff.py
@@ -6,7 +6,7 @@ from gn3.commands import run_cmd
def generate_diff(data: str, edited_data: str) -> Optional[str]:
"""Generate the diff between 2 files"""
- results = run_cmd(f"diff {data} {edited_data}", success_codes=[1, 2])
+ results = run_cmd(f"diff {data} {edited_data}", success_codes=(1, 2))
if results.get("code", -1) > 0:
return results.get("output")
return None