Thread: Fix key error

Fix key error

From
Dave Cramer
Date:
I don't think this line in web/pgadmin/browser/server_groups/servers/types.py does what it should.

default_path = config.DEFAULT_BINARY_PATHS[st.stype] or ""

will ever succeed if the key does not exist

Attached patch should work.

Dave Cramer
Attachment

Re: Fix key error

From
Surinder Kumar
Date:

Hi,

On Tue, Aug 8, 2017 at 12:23 AM, Dave Cramer <davecramer@gmail.com> wrote:

I don't think this line in web/pgadmin/browser/server_groups/servers/types.py does what it should.

default_path = config.DEFAULT_BINARY_PATHS[st.stype] or ""

will ever succeed if the key does not exist

Attached patch should work.

​It can be written as:

default_path = config.DEFAULT_BINARY_PATHS.get(st.stype, "")

Reference link

​Thanks for the patch.​


Dave Cramer