File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 7
7
import testgres
8
8
import hashlib
9
9
import re
10
- import pwd
10
+ import getpass
11
11
import select
12
12
import psycopg2
13
13
from time import sleep
@@ -89,8 +89,14 @@ def dir_files(base_dir):
89
89
90
90
def is_enterprise ():
91
91
# pg_config --help
92
+ if os .name == 'posix' :
93
+ cmd = [os .environ ['PG_CONFIG' ], '--help' ]
94
+
95
+ elif os .name == 'nt' :
96
+ cmd = [[os .environ ['PG_CONFIG' ]], ['--help' ]]
97
+
92
98
p = subprocess .Popen (
93
- [ os . environ [ 'PG_CONFIG' ], '--help' ] ,
99
+ cmd ,
94
100
stdout = subprocess .PIPE ,
95
101
stderr = subprocess .PIPE
96
102
)
@@ -955,7 +961,7 @@ def get_pgpro_edition(self, node):
955
961
956
962
def get_username (self ):
957
963
""" Returns current user name """
958
- return pwd . getpwuid ( os . getuid ())[ 0 ]
964
+ return getpass . getuser ()
959
965
960
966
def version_to_num (self , version ):
961
967
if not version :
You can’t perform that action at this time.
0 commit comments