[3.6] bpo-21519: IDLE basic custom key entry better detects duplicates. (GH-2428) (#2433)

Original patch by Saimadhav Heblikar.
(cherry picked from commit 44913e5)
This commit is contained in:
terryjreedy 2017-06-27 01:58:18 -04:00 committed by GitHub
parent 8bdc3bd3d6
commit 93b88e9953
3 changed files with 15 additions and 7 deletions

View file

@ -250,10 +250,10 @@ class GetKeysDialog(Toplevel):
'''
finalKey = self.listKeysFinal.get(ANCHOR)
modifiers = self.GetModifiers()
# create a key sequence list for overlap check:
keySequence = keys.split()
keysOK = False
title = self.keyerror_title
key_sequences = [key for keylist in self.currentKeySequences
for key in keylist]
if not keys.endswith('>'):
self.showerror(title, parent=self,
message='Missing the final Key')
@ -267,7 +267,7 @@ class GetKeysDialog(Toplevel):
msg = 'The shift modifier by itself may not be used with'\
' this key symbol.'
self.showerror(title=title, parent=self, message=msg)
elif keySequence in self.currentKeySequences:
elif keys in key_sequences:
msg = 'This key combination is already in use.'
self.showerror(title=title, parent=self, message=msg)
else: