| 1236 | class _DNSPacketListField(PacketListField): |
| 1237 | # A normal PacketListField with backward-compatible hacks |
| 1238 | def any2i(self, pkt, x): |
| 1239 | # type: (Optional[Packet], List[Any]) -> List[Any] |
| 1240 | if x is None: |
| 1241 | warnings.warn( |
| 1242 | ("The DNS fields 'qd', 'an', 'ns' and 'ar' are now " |
| 1243 | "PacketListField(s) ! " |
| 1244 | "Setting a null default should be [] instead of None"), |
| 1245 | DeprecationWarning |
| 1246 | ) |
| 1247 | x = [] |
| 1248 | return super(_DNSPacketListField, self).any2i(pkt, x) |
| 1249 | |
| 1250 | def i2h(self, pkt, x): |
| 1251 | # type: (Optional[Packet], List[Packet]) -> Any |