File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,13 +46,12 @@ class ClientParameterError(Error):
4646class ServiceDoesNotExistError (ClientParameterError ):
4747 code = '-*srv'
4848
49- # on win32 when program is run as windows service, getuser falls back to pwn which is not implemented
50- # therefore it is better to resign from getting default username, which allows service operation
51-
52- getpass = raw_input
53-
54- def getuser ():
55- return 'postgres'
49+ try :
50+ from getpass import getuser , getpass
51+ except ImportError :
52+ getpass = raw_input
53+ def getuser ():
54+ return 'postgres'
5655
5756default_host = 'localhost'
5857default_port = 5432
@@ -142,9 +141,6 @@ def defaults(environ = os.environ):
142141 if appdata :
143142 pgdata = os .path .join (appdata , pg_appdata_directory )
144143 pgpassfile = os .path .join (pgdata , pg_appdata_passfile )
145- else :
146- pgdata = ''
147- pgpassfile = ''
148144 else :
149145 pgpassfile = os .path .join (userdir , pg_home_passfile )
150146
You can’t perform that action at this time.
0 commit comments