mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-06 03:15:23 +01:00
Change Python -> python
(lowercase convention)
This commit is contained in:
parent
a4d1a445ac
commit
6ec368ce37
46 changed files with 30 additions and 30 deletions
29
sysc/python-2.5.6/patches/sorted.patch
Normal file
29
sysc/python-2.5.6/patches/sorted.patch
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
|
||||
|
||||
SPDX-License-Identifier: PSF-2.0
|
||||
|
||||
sorted() was only added in Python 2.5. But we are building Python 2.5.
|
||||
|
||||
We cannot use .sort(), as it doesn't support the key= parameter.
|
||||
Instead we just use a basic custom selection sort to sort it ourselves
|
||||
using a custom key.
|
||||
|
||||
--- Tools/compiler/astgen.py.bak 2022-07-11 09:24:59.600238862 +1000
|
||||
+++ Tools/compiler/astgen.py 2022-07-11 09:32:25.814974174 +1000
|
||||
@@ -215,7 +215,15 @@
|
||||
# some extra code for a Node's __init__ method
|
||||
name = mo.group(1)
|
||||
cur = classes[name]
|
||||
- return sorted(classes.values(), key=lambda n: n.name)
|
||||
+ ret = classes.values()
|
||||
+ # basic custom selection sort
|
||||
+ for i in range(len(ret)):
|
||||
+ min_i = i
|
||||
+ for j in range(i + 1, len(ret)):
|
||||
+ if ret[min_i].name > ret[j].name:
|
||||
+ min_i = j
|
||||
+ ret[i], ret[min_i] = ret[min_i], ret[i]
|
||||
+ return ret
|
||||
|
||||
def main():
|
||||
prologue, epilogue = load_boilerplate(sys.argv[-1])
|
||||
Loading…
Add table
Add a link
Reference in a new issue