From df5f7a0c831a77b4c981e168a5dbbdcaaa4d90b9 Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 17 Apr 2020 20:24:30 +1000 Subject: Update Python versions. Modules that are only used as top level scripts or from scripts that require Python 3.6 have Python 2.x support removed. Modules that may be called from Python 2 for PySide require Python 2.7. Documented how to run scripts. --- scripts/ScintillaData.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'scripts/ScintillaData.py') diff --git a/scripts/ScintillaData.py b/scripts/ScintillaData.py index 17ac33d27..5bb9fb1bc 100644 --- a/scripts/ScintillaData.py +++ b/scripts/ScintillaData.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 # ScintillaData.py - implemented 2013 by Neil Hodgson neilh@scintilla.org # Released to the public domain. @@ -30,7 +31,7 @@ # dictionary of file names { SCLEX_ID: file name } # This file can be run to see the data it provides. -# Requires Python 2.7 or later +# Requires Python 3.6 or later from __future__ import with_statement @@ -178,17 +179,11 @@ def FindCredits(historyFile): credits.append(credit) return credits -def ciCompare(a,b): - return cmp(a.lower(), b.lower()) - def ciKey(a): return a.lower() def SortListInsensitive(l): - try: # Try key function - l.sort(key=ciKey) - except TypeError: # Earlier version of Python, so use comparison function - l.sort(ciCompare) + l.sort(key=ciKey) class ScintillaData: def __init__(self, scintillaRoot): -- cgit v1.2.3