Обсуждение: Fix key error

Поиск
Список
Период
Сортировка

Fix key error

От
Dave Cramer
Дата:
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
Вложения

Re: Fix key error

От
Surinder Kumar
Дата:

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