Repository navigation
Commit ef4d93f
authored
SCTP._make_param_addrtypes and _make_cause_missing_param shared the
conversion "Enum_Parameter.get(item) if isinstance(item, int) else item":
True became parameter type 1, False raised EnumValueError, and a str or
float item was stored unchecked.
Both makers now call one helper, _make_param_types, which raises
ProtocolError "SCTP: invalid parameter type: ..." for a bool or any item
that is neither a Parameter nor an int. The helper is documented in
sctp.rst, since both makers' docstrings refer to it.
Test: test_parameter_type_lists_refuse_a_bool_and_a_non_int pins the
message for True, False, '5', 5.0 and None in both makers.
1 parent 7c4d7ce commit ef4d93f
3 files changed
Lines changed: 72 additions & 4 deletions
File tree
- docs/source/pcapkit/protocols/transport
- pcapkit/protocols/transport
- tests/protocols/transport
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1257 | 1257 | | |
1258 | 1258 | | |
1259 | 1259 | | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
1260 | 1291 | | |
1261 | 1292 | | |
1262 | 1293 | | |
| |||
2998 | 3029 | | |
2999 | 3030 | | |
3000 | 3031 | | |
| 3032 | + | |
| 3033 | + | |
| 3034 | + | |
| 3035 | + | |
3001 | 3036 | | |
3002 | 3037 | | |
3003 | 3038 | | |
3004 | 3039 | | |
3005 | | - | |
3006 | | - | |
| 3040 | + | |
3007 | 3041 | | |
3008 | 3042 | | |
3009 | 3043 | | |
| |||
3561 | 3595 | | |
3562 | 3596 | | |
3563 | 3597 | | |
| 3598 | + | |
| 3599 | + | |
| 3600 | + | |
| 3601 | + | |
3564 | 3602 | | |
3565 | 3603 | | |
3566 | 3604 | | |
| |||
3570 | 3608 | | |
3571 | 3609 | | |
3572 | 3610 | | |
3573 | | - | |
3574 | | - | |
| 3611 | + | |
3575 | 3612 | | |
3576 | 3613 | | |
3577 | 3614 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
163 | 193 | | |
164 | 194 | | |
165 | 195 | | |
| |||
0 commit comments