Skip to content

Commit 4544938

Browse files
author
James William Pye
committed
Improve win32 compatilibity.
* close_fds is not supported * check for executable existence against path + '.exe' on win32.
1 parent 8458d31 commit 4544938

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

postgresql/cluster.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ def init(self,
203203
+ extra_args
204204
p = sp.Popen(
205205
cmd,
206-
close_fds = True,
207206
stdin = sp.PIPE,
208207
stdout = logfile,
209208
stderr = sp.PIPE
@@ -284,7 +283,6 @@ def start(self,
284283

285284
p = sp.Popen(
286285
cmd,
287-
close_fds = True,
288286
stdout = sp.PIPE if logfile is None else logfile,
289287
stderr = sp.STDOUT,
290288
stdin = sp.PIPE,

postgresql/installation.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,13 @@ def parse_configure_options(confopt):
9494
kv = x.split('=', 1) + [True]
9595
yield (kv[0].replace('-','_'), kv[1])
9696

97+
def platform_binary(path):
98+
return path
99+
100+
if sys.platform == 'win32':
101+
def platform_binary(path):
102+
return path + '.exe'
103+
97104
installations = {}
98105
class Installation(pg_api.Installation):
99106
"""
@@ -218,7 +225,8 @@ def __init__(self, pg_config_path):
218225
k : v for k,v in (
219226
(k, (v if os.path.exists(v) else None)) for k,v in chain(
220227
(
221-
(k, os.path.join(bindir_path, k)) for k in self.pg_binaries
228+
(k, platform_binary(os.path.join(bindir_path, k)))
229+
for k in self.pg_binaries
222230
),
223231
(
224232
(k, self.pg_config_data[k]) for k in

0 commit comments

Comments
 (0)