Skip to content

Commit cb5d73b

Browse files
committed
BUG25215081: Remove dictionary comprehension lists
Dictionary comprehension lists is not supported in python 2.6 which causes this error. Using the dict initializer with tuple works the same as dictionary comprehension lists and is also supported in python 2.6.
1 parent 632b7a7 commit cb5d73b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/mysql/connector/optionfiles.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,10 @@ def get_groups_as_dict_with_priority(self, *args): # pylint: disable=C0103
321321
options = dict()
322322
for group in args:
323323
try:
324-
options[group] = {key: value for key, value in
325-
self._options_dict[group].items() if
326-
key != "__name__" and
327-
not key.startswith("!")}
324+
options[group] = dict((key, value,) for key, value in
325+
self._options_dict[group].items() if
326+
key != "__name__" and
327+
not key.startswith("!"))
328328
except KeyError:
329329
pass
330330

@@ -346,10 +346,10 @@ def get_groups_as_dict(self, *args):
346346
options = dict()
347347
for group in args:
348348
try:
349-
options[group] = {key: value[0] for key, value in
350-
self._options_dict[group].items() if
351-
key != "__name__" and
352-
not key.startswith("!")}
349+
options[group] = dict((key, value[0],) for key, value in
350+
self._options_dict[group].items() if
351+
key != "__name__" and
352+
not key.startswith("!"))
353353
except KeyError:
354354
pass
355355

0 commit comments

Comments
 (0)