Commit 3a4f667
Cut disused recode_encoding logic in _PyBytes_DecodeEscape. (GH-16013)
All call sites pass NULL for `recode_encoding`, so this path is completely untested. That's been true since before Python 3.0. It adds significant complexity to this logic, so it's best to take it out. All call sites now have a literal NULL, and that's been true since commit 768921c eliminated a conditional (`foo ? bar : NULL`) at the call site in Python/ast.c where we're parsing a bytes literal. But even before then, that condition `foo` had been a constant since unadorned string literals started meaning Unicode, in commit 572dbf8 aka v3.0a1~1035 . The `unicode` parameter is already unused, so mark it as unused too. The code that acted on it was also taken out before Python 3.0, in commit 8d30cc0 aka v3.0a1~1031 . The function (PyBytes_DecodeEscape) is exposed in the API, but it's never been documented.1 parent a44f3dc commit 3a4f667
File tree
4 files changed
+8
-63
lines changed- Include
- Objects
- Python
4 files changed
+8
-63
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | | - | |
| 80 | + | |
83 | 81 | | |
84 | 82 | | |
85 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1077 | 1077 | | |
1078 | 1078 | | |
1079 | 1079 | | |
1080 | | - | |
1081 | | - | |
1082 | | - | |
1083 | | - | |
1084 | | - | |
1085 | | - | |
1086 | | - | |
1087 | | - | |
1088 | | - | |
1089 | | - | |
1090 | | - | |
1091 | | - | |
1092 | | - | |
1093 | | - | |
1094 | | - | |
1095 | | - | |
1096 | | - | |
1097 | | - | |
1098 | | - | |
1099 | | - | |
1100 | | - | |
1101 | | - | |
1102 | | - | |
1103 | | - | |
1104 | | - | |
1105 | | - | |
1106 | | - | |
1107 | | - | |
1108 | | - | |
1109 | | - | |
1110 | | - | |
1111 | | - | |
1112 | | - | |
1113 | | - | |
1114 | | - | |
1115 | | - | |
1116 | | - | |
1117 | | - | |
1118 | | - | |
1119 | | - | |
1120 | | - | |
| 1080 | + | |
1121 | 1081 | | |
1122 | 1082 | | |
1123 | 1083 | | |
1124 | | - | |
1125 | | - | |
1126 | 1084 | | |
1127 | 1085 | | |
1128 | 1086 | | |
| |||
1142 | 1100 | | |
1143 | 1101 | | |
1144 | 1102 | | |
1145 | | - | |
1146 | | - | |
1147 | | - | |
1148 | | - | |
1149 | | - | |
1150 | | - | |
1151 | | - | |
1152 | | - | |
1153 | | - | |
1154 | | - | |
1155 | | - | |
| 1103 | + | |
1156 | 1104 | | |
1157 | 1105 | | |
1158 | 1106 | | |
| |||
1241 | 1189 | | |
1242 | 1190 | | |
1243 | 1191 | | |
1244 | | - | |
1245 | | - | |
| 1192 | + | |
| 1193 | + | |
1246 | 1194 | | |
1247 | 1195 | | |
1248 | | - | |
1249 | | - | |
| 1196 | + | |
1250 | 1197 | | |
1251 | 1198 | | |
1252 | 1199 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4766 | 4766 | | |
4767 | 4767 | | |
4768 | 4768 | | |
4769 | | - | |
| 4769 | + | |
4770 | 4770 | | |
4771 | 4771 | | |
4772 | 4772 | | |
| |||
0 commit comments