3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/os-specific/darwin/apple-source-releases/xnu/python3.patch
toonn e07eef85e8 xnu: Fix python3 patch
This reverts 7da313e10a because it's no
longer necessary.
2021-11-24 15:17:13 -08:00

42 lines
1.2 KiB
Diff

diff --git a/bsd/kern/makekdebugevents.py b/bsd/kern/makekdebugevents.py
index 73b2db4..d354ba0 100755
--- a/bsd/kern/makekdebugevents.py
+++ b/bsd/kern/makekdebugevents.py
@@ -5,7 +5,7 @@
# named kd_events[] or these mappings.
# Required to generate a header file used by DEVELOPMENT and DEBUG kernels.
#
-
+
import sys
import re
@@ -21,18 +21,18 @@ code_table = []
# scan file to generate internal table
with open(trace_code_file, 'rt') as codes:
for line in codes:
- m = id_name_pattern.match(line)
- if m:
+ m = id_name_pattern.match(line)
+ if m:
code_table += [(int(m.group(1),base=16), m.group(2))]
# emit typedef:
-print "typedef struct {"
-print " uint32_t id;"
-print " const char *name;"
-print "} kd_event_t;"
+print("typedef struct {")
+print(" uint32_t id;")
+print(" const char *name;")
+print("} kd_event_t;")
# emit structure declaration and sorted initialization:
-print "kd_event_t kd_events[] = {"
+print("kd_event_t kd_events[] = {")
for mapping in sorted(code_table, key=lambda x: x[0]):
- print " {0x%x, \"%s\"}," % mapping
-print "};"
+ print(" {0x%x, \"%s\"}," % mapping)
+print("};")