Mercurial > hg
changeset 49293:e3143ab9dadb
zeroconf: constant-fold a `pycompat.ispy3`
I’ve checked that both bytes and str gets passed as the `name` parameter, so
the rest of the condition is still required. Because there aren’t really any
tests for the extensions, I didn’t want to refactor it to pass a single type.
author | Manuel Jacob <me@manueljacob.de> |
---|---|
date | Tue, 31 May 2022 02:04:24 +0200 |
parents | 33872fec41e7 |
children | 003c0732c055 |
files | hgext/zeroconf/Zeroconf.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/zeroconf/Zeroconf.py Tue May 31 01:23:19 2022 +0200 +++ b/hgext/zeroconf/Zeroconf.py Tue May 31 02:04:24 2022 +0200 @@ -292,7 +292,7 @@ """A DNS question entry""" def __init__(self, name, type, clazz): - if pycompat.ispy3 and isinstance(name, str): + if isinstance(name, str): name = name.encode('ascii') if not name.endswith(b".local."): raise NonLocalNameException(name)