summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-01-31 09:27:06 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-01-31 09:27:06 (GMT)
commit5312a7f912088361e2a1fccd5daeaa9dc4ff5fd3 (patch)
tree48d4a3f45af918d461fa46ed3015e6ff652f61cb
parent7ece150395f9908870c3baa883e465ec9fe4dd9c (diff)
downloadcpython-5312a7f912088361e2a1fccd5daeaa9dc4ff5fd3.zip
cpython-5312a7f912088361e2a1fccd5daeaa9dc4ff5fd3.tar.gz
cpython-5312a7f912088361e2a1fccd5daeaa9dc4ff5fd3.tar.bz2
Avoid deprecation warnings.
-rw-r--r--Lib/ctypes/util.py2
-rw-r--r--Lib/encodings/uu_codec.py2
-rw-r--r--Lib/test/test_descr.py2
-rw-r--r--Lib/test/test_exceptions.py2
-rw-r--r--Lib/test/test_ssl.py2
-rw-r--r--Lib/test/test_threading.py6
-rw-r--r--Lib/test/test_timeit.py2
7 files changed, 9 insertions, 9 deletions
diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
index fe0ed0a..1e882e3 100644
--- a/Lib/ctypes/util.py
+++ b/Lib/ctypes/util.py
@@ -177,7 +177,7 @@ elif os.name == "posix":
res = re.findall(expr, data)
if not res:
return _get_soname(_findLib_gcc(name))
- res.sort(cmp= lambda x,y: cmp(_num_version(x), _num_version(y)))
+ res.sort(key=_num_version)
return res[-1]
elif sys.platform == "sunos5":
diff --git a/Lib/encodings/uu_codec.py b/Lib/encodings/uu_codec.py
index fb03758..4b137a5 100644
--- a/Lib/encodings/uu_codec.py
+++ b/Lib/encodings/uu_codec.py
@@ -84,7 +84,7 @@ def uu_decode(input,errors='strict'):
data = a2b_uu(s)
except binascii.Error, v:
# Workaround for broken uuencoders by /Fredrik Lundh
- nbytes = (((ord(s[0])-32) & 63) * 4 + 5) / 3
+ nbytes = (((ord(s[0])-32) & 63) * 4 + 5) // 3
data = a2b_uu(s[:nbytes])
#sys.stderr.write("Warning: %s\n" % str(v))
write(data)
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index 9d62779..0ac458f 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -2066,7 +2066,7 @@ order (MRO) for bases """
"attr on a property" % attr)
class D(object):
- __getitem__ = property(lambda s: 1/0)
+ __getitem__ = property(lambda s: 1.0/0.0)
d = D()
try:
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index dc02cb3..b950031 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -92,7 +92,7 @@ class ExceptionTests(unittest.TestCase):
self.raise_catch(TabError, "TabError")
# can only be tested under -tt, and is the only test for -tt
- #try: compile("try:\n\t1/0\n \t1/0\nfinally:\n pass\n", '<string>', 'exec')
+ #try: compile("try:\n\t1.0/0.0\n \t1.0/0.0\nfinally:\n pass\n", '<string>', 'exec')
#except TabError: pass
#else: self.fail("TabError not raised")
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index f3da0b1..6c342d8 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -2954,7 +2954,7 @@ else:
server_context, other_context, client_context = self.sni_contexts()
def cb_raising(ssl_sock, server_name, initial_context):
- 1/0
+ 1.0/0.0
server_context.set_servername_callback(cb_raising)
with self.assertRaises(ssl.SSLError) as cm, \
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index 00b8d19..44f2c57 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
@@ -797,7 +797,7 @@ class ThreadingExceptionTests(BaseTestCase):
running = True
while running:
time.sleep(0.01)
- 1/0
+ 1.0/0.0
t = threading.Thread(target=run)
t.start()
while not running:
@@ -824,7 +824,7 @@ class ThreadingExceptionTests(BaseTestCase):
running = True
while running:
time.sleep(0.01)
- 1/0
+ 1.0/0.0
t = threading.Thread(target=run)
t.start()
while not running:
@@ -852,7 +852,7 @@ class ThreadingExceptionTests(BaseTestCase):
running = True
while running:
time.sleep(0.01)
- 1/0
+ 1.0/0.0
sys.stderr = None
t = threading.Thread(target=run)
t.start()
diff --git a/Lib/test/test_timeit.py b/Lib/test/test_timeit.py
index 7154217..a084b68 100644
--- a/Lib/test/test_timeit.py
+++ b/Lib/test/test_timeit.py
@@ -197,7 +197,7 @@ class TestTimeit(unittest.TestCase):
def test_print_exc(self):
s = StringIO()
- t = timeit.Timer("1/0")
+ t = timeit.Timer("1.0/0.0")
try:
t.timeit()
except: