[PATCH 4 of 4] zeroconf: replace has_key with in
timeless
timeless at mozdev.org
Tue Mar 8 23:24:01 EST 2016
# HG changeset patch
# User timeless <timeless at mozdev.org>
# Date 1456827730 0
# Tue Mar 01 10:22:10 2016 +0000
# Node ID a443820c59be348fe56ba28ef2ef448ed9b97f1c
# Parent 8e2e04f015097b7df7121a8bc840ee8c43cb59d3
zeroconf: replace has_key with in
diff --git a/hgext/zeroconf/Zeroconf.py b/hgext/zeroconf/Zeroconf.py
--- a/hgext/zeroconf/Zeroconf.py
+++ b/hgext/zeroconf/Zeroconf.py
@@ -1389,7 +1389,7 @@
changed if needed to make it unique on the network."""
self.checkService(info)
self.services[info.name.lower()] = info
- if self.servicetypes.has_key(info.type):
+ if info.type in self.servicetypes:
self.servicetypes[info.type] += 1
else:
self.servicetypes[info.type] = 1
@@ -1678,5 +1678,3 @@
r.unregisterService(info)
print(" Unregister done.")
r.close()
-
-# no-check-code
diff --git a/tests/test-check-code.t b/tests/test-check-code.t
--- a/tests/test-check-code.t
+++ b/tests/test-check-code.t
@@ -8,7 +8,6 @@
$ hg locate | sed 's-\\-/-g' |
> xargs "$check_code" --warnings --per-file=0 || false
- Skipping hgext/zeroconf/Zeroconf.py it has no-che?k-code (glob)
Skipping i18n/polib.py it has no-che?k-code (glob)
Skipping mercurial/httpclient/__init__.py it has no-che?k-code (glob)
Skipping mercurial/httpclient/_readers.py it has no-che?k-code (glob)
More information about the Mercurial-devel
mailing list