Merge pull request #61 from shenki/is-not

Fix "is not" literal SyntaxWarning
This commit is contained in:
enjoy-digital 2021-02-16 15:14:39 +01:00 committed by GitHub
commit 89b197d1a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -45,7 +45,7 @@ class LiteEthUDPCrossbar(LiteEthCrossbar):
# tx # tx
tx_stream = user_port.sink tx_stream = user_port.sink
if cd is not "sys": if cd != "sys":
tx_cdc = stream.AsyncFIFO(eth_udp_user_description(user_port.dw), 4) tx_cdc = stream.AsyncFIFO(eth_udp_user_description(user_port.dw), 4)
tx_cdc = ClockDomainsRenamer({"write": cd, "read": "sys"})(tx_cdc) tx_cdc = ClockDomainsRenamer({"write": cd, "read": "sys"})(tx_cdc)
self.submodules += tx_cdc self.submodules += tx_cdc
@ -69,7 +69,7 @@ class LiteEthUDPCrossbar(LiteEthCrossbar):
self.submodules += rx_converter self.submodules += rx_converter
self.comb += rx_stream.connect(rx_converter.sink) self.comb += rx_stream.connect(rx_converter.sink)
rx_stream = rx_converter.source rx_stream = rx_converter.source
if cd is not "sys": if cd != "sys":
rx_cdc = stream.AsyncFIFO(eth_udp_user_description(user_port.dw), 4) rx_cdc = stream.AsyncFIFO(eth_udp_user_description(user_port.dw), 4)
rx_cdc = ClockDomainsRenamer({"write": "sys", "read": cd})(rx_cdc) rx_cdc = ClockDomainsRenamer({"write": "sys", "read": cd})(rx_cdc)
self.submodules += rx_cdc self.submodules += rx_cdc

View File

@ -9,7 +9,7 @@ import re
# Helpers ------------------------------------------------------------------------------------------ # Helpers ------------------------------------------------------------------------------------------
def format_dump(dump): def format_dump(dump):
return [int(s, 16) for s in re.split(r'[;,\s\n]\s*', dump) if s is not ""] return [int(s, 16) for s in re.split(r'[;,\s\n]\s*', dump) if s != ""]
def verify_packet(packet, infos): def verify_packet(packet, infos):