Skip to content

Commit e742c9c

Browse files
get_bin_path2 and get_bin_dir use get_pg_config2 directly (#384)
get_bin_path2 and get_bin_dir require os_ops for their work. So we can use get_pg_config2 there directly, not via get_pg_config.
1 parent a251b0c commit e742c9c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def get_bin_path2(os_ops: OsOperations, filename):
156156
pg_config = os.environ.get("PG_CONFIG")
157157

158158
if pg_config:
159-
bindir = get_pg_config(pg_config, os_ops)["BINDIR"]
159+
bindir = get_pg_config2(os_ops, pg_config)["BINDIR"]
160160
return os_ops.build_path(bindir, filename)
161161

162162
# try PG_BIN
@@ -166,7 +166,7 @@ def get_bin_path2(os_ops: OsOperations, filename):
166166

167167
pg_config_path = os_ops.find_executable('pg_config')
168168
if pg_config_path:
169-
bindir = get_pg_config(pg_config_path, os_ops)["BINDIR"]
169+
bindir = get_pg_config2(os_ops, pg_config_path)["BINDIR"]
170170
return os_ops.build_path(bindir, filename)
171171

172172
return filename
@@ -183,7 +183,7 @@ def get_bin_dir(os_ops: OsOperations) -> str:
183183
pg_config = os.environ.get("PG_CONFIG")
184184

185185
if pg_config:
186-
return get_pg_config(pg_config, os_ops)["BINDIR"]
186+
return get_pg_config2(os_ops, pg_config)["BINDIR"]
187187

188188
# try PG_BIN
189189
pg_bin = os_ops.environ("PG_BIN")
@@ -192,7 +192,7 @@ def get_bin_dir(os_ops: OsOperations) -> str:
192192

193193
pg_config_path = os_ops.find_executable('pg_config')
194194
if pg_config_path:
195-
return get_pg_config(pg_config_path, os_ops)["BINDIR"]
195+
return get_pg_config2(os_ops, pg_config_path)["BINDIR"]
196196

197197
postgres = os_ops.find_executable('postgres')
198198
if postgres:

0 commit comments

Comments
 (0)