summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Lecher <jlec@gentoo.org>2015-10-20 10:35:45 +0200
committerJustin Lecher <jlec@gentoo.org>2015-10-21 15:40:24 +0200
commit9d7fd59c337d4c6583b74e21da85bc37bb4629dd (patch)
tree20a171a3fcc436d3ff9d1c7250987820d3cf9c2c /www-servers
parentdev-python/pycurl: Add python3.5 support (diff)
downloadgentoo-9d7fd59c337d4c6583b74e21da85bc37bb4629dd.tar.gz
gentoo-9d7fd59c337d4c6583b74e21da85bc37bb4629dd.tar.bz2
gentoo-9d7fd59c337d4c6583b74e21da85bc37bb4629dd.zip
www-servers/tornado: Add python3.5 support
Package-Manager: portage-2.2.23 Signed-off-by: Justin Lecher <jlec@gentoo.org>
Diffstat (limited to 'www-servers')
-rw-r--r--www-servers/tornado/files/tornado-4.2.1-py3.5-backport.patch63
-rw-r--r--www-servers/tornado/metadata.xml2
-rw-r--r--www-servers/tornado/tornado-4.2.1.ebuild3
3 files changed, 66 insertions, 2 deletions
diff --git a/www-servers/tornado/files/tornado-4.2.1-py3.5-backport.patch b/www-servers/tornado/files/tornado-4.2.1-py3.5-backport.patch
new file mode 100644
index 000000000000..e649935d7048
--- /dev/null
+++ b/www-servers/tornado/files/tornado-4.2.1-py3.5-backport.patch
@@ -0,0 +1,63 @@
+From 2971e857104f8d02fa9107a0e13f50170eb4f30d Mon Sep 17 00:00:00 2001
+From: Ben Darnell <ben@bendarnell.com>
+Date: Sat, 6 Jun 2015 15:40:21 -0400
+Subject: [PATCH] Get the tests passing under Python 3.5b2
+
+---
+ tornado/test/web_test.py | 7 +++++--
+ tornado/util.py | 10 ++++++++--
+ 2 files changed, 13 insertions(+), 4 deletions(-)
+
+diff --git a/tornado/test/web_test.py b/tornado/test/web_test.py
+index 96edd6c..a93369c 100644
+--- a/tornado/test/web_test.py
++++ b/tornado/test/web_test.py
+@@ -1538,8 +1538,11 @@ def get(self):
+ def test_clear_all_cookies(self):
+ response = self.fetch('/', headers={'Cookie': 'foo=bar; baz=xyzzy'})
+ set_cookies = sorted(response.headers.get_list('Set-Cookie'))
+- self.assertTrue(set_cookies[0].startswith('baz=;'))
+- self.assertTrue(set_cookies[1].startswith('foo=;'))
++ # Python 3.5 sends 'baz="";'; older versions use 'baz=;'
++ self.assertTrue(set_cookies[0].startswith('baz=;') or
++ set_cookies[0].startswith('baz="";'))
++ self.assertTrue(set_cookies[1].startswith('foo=;') or
++ set_cookies[1].startswith('foo="";'))
+
+
+ class PermissionError(Exception):
+diff --git a/tornado/util.py b/tornado/util.py
+index 606ced1..ea4da87 100644
+--- a/tornado/util.py
++++ b/tornado/util.py
+@@ -13,7 +13,6 @@
+ from __future__ import absolute_import, division, print_function, with_statement
+
+ import array
+-import inspect
+ import os
+ import sys
+ import zlib
+@@ -24,6 +23,13 @@
+ except NameError:
+ xrange = range # py3
+
++# inspect.getargspec() raises DeprecationWarnings in Python 3.5.
++# The two functions have compatible interfaces for the parts we need.
++try:
++ from inspect import getfullargspec as getargspec # py3
++except ImportError:
++ from inspect import getargspec # py2
++
+
+ class ObjectDict(dict):
+ """Makes a dictionary behave like an object, with attribute-style access.
+@@ -284,7 +290,7 @@ class ArgReplacer(object):
+ def __init__(self, func, name):
+ self.name = name
+ try:
+- self.arg_pos = inspect.getargspec(func).args.index(self.name)
++ self.arg_pos = getargspec(func).args.index(self.name)
+ except ValueError:
+ # Not a positional parameter
+ self.arg_pos = None
diff --git a/www-servers/tornado/metadata.xml b/www-servers/tornado/metadata.xml
index b110d73d613c..ec9b762db147 100644
--- a/www-servers/tornado/metadata.xml
+++ b/www-servers/tornado/metadata.xml
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<herd>python</herd>
diff --git a/www-servers/tornado/tornado-4.2.1.ebuild b/www-servers/tornado/tornado-4.2.1.ebuild
index 279be3f52ae7..9187a2848924 100644
--- a/www-servers/tornado/tornado-4.2.1.ebuild
+++ b/www-servers/tornado/tornado-4.2.1.ebuild
@@ -4,7 +4,7 @@
EAPI=5
-PYTHON_COMPAT=( python2_7 python3_3 python3_4 )
+PYTHON_COMPAT=( python2_7 python3_{3,4,5} )
inherit distutils-r1
@@ -44,6 +44,7 @@ RDEPEND="${CDEPEND}"
python_prepare_all() {
local PATCHES=(
"${FILESDIR}"/drop-intersphinx.patch
+ "${FILESDIR}"/${P}-py3.5-backport.patch
)
distutils-r1_python_prepare_all