Python 2.6 support fixes.

This commit is contained in:
Harshal Dhumal
2016-01-27 15:59:54 +01:00
committed by Dave Page
parent d6d8a2348e
commit b77c5a6c54
5 changed files with 9 additions and 9 deletions

View File

@@ -90,6 +90,6 @@ class PgAdminModule(Blueprint):
for module in self.submodules:
for key, value in module.menu_items.items():
menu_items[key].extend(value)
menu_items = {key: sorted(values, key=attrgetter('priority'))
for key, values in menu_items.items()}
menu_items = dict((key, sorted(value, key=attrgetter('priority')))
for key, value in menu_items.items())
return menu_items

View File

@@ -372,7 +372,7 @@ Attempt to reconnect it failed with the below error:
import copy
# Get Resultset Column Name, Type and size
columns = cur.description and [
copy.deepcopy(desc.__dict__) for desc in cur.description
copy.deepcopy(desc._asdict()) for desc in cur.description
] or []
rows = []
@@ -414,7 +414,7 @@ Attempt to reconnect it failed with the below error:
import copy
# Get Resultset Column Name, Type and size
columns = cur.description and [
copy.deepcopy(desc.__dict__) for desc in cur.description
copy.deepcopy(desc._asdict()) for desc in cur.description
] or []
rows = []