Skip to content

Commit

Permalink
fix: support python 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesGuthrie committed May 13, 2024
1 parent 6ac31f2 commit bdf8b28
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This repository provides scripts that assist the Timescale migration team
in selecting the optimal migration strategy to Timescale Cloud for your
specific database.

You will need `Python 3.7.x` or above and `psql` to run the scripts.
You will need `Python 3.6.x` or above and `psql` to run the scripts.

To recommend a suitable migration strategy for your database, we'll need
some information about its current state. You can collect this information
Expand Down
4 changes: 2 additions & 2 deletions evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@

def execute(sql: str) -> str:
cmd = ["psql", "-X", "-A", "-t", "-q", "-F", ",", "-v", "ON_ERROR_STOP=1", "--echo-errors", "-d", POSTGRES_URI, "-c", sql]
result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
output = str(result.stdout)[:-1].strip()
if result.returncode != 0:
return "-"
Expand All @@ -300,7 +300,7 @@ def execute(sql: str) -> str:

def test_conn() -> bool:
cmd = ["psql", "-X", "-A", "-t", "-v", "ON_ERROR_STOP=1", "--echo-errors", "-d", POSTGRES_URI, "-c", "select 1"]
result = subprocess.run(cmd, text=True, stdout=subprocess.PIPE)
result = subprocess.run(cmd, universal_newlines=True, stdout=subprocess.PIPE)
if result.returncode != 0:
sys.exit(1)

Expand Down

0 comments on commit bdf8b28

Please sign in to comment.