summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Gedminas <marius@gedmin.as>2015-11-13 12:57:44 +0200
committerMarius Gedminas <marius@gedmin.as>2015-11-13 12:57:44 +0200
commit65009b236143ae0d0a000f816a2fc2d1862d1a75 (patch)
tree2a6bae44719729c797523c2ff7d42609377bc8a4
parent3e48d6c2df25101e9865921b4aff49aa7972b624 (diff)
parentab99c4d7bfe1d83c704580037e5790bb5d2c622a (diff)
downloadzope-tal-65009b236143ae0d0a000f816a2fc2d1862d1a75.tar.gz
Merge pull request #5 from felixonmars/master
Note explicit support for Python 3.5
-rw-r--r--.travis.yml4
-rw-r--r--CHANGES.rst2
-rw-r--r--README.rst4
-rw-r--r--setup.py1
-rw-r--r--src/zope/tal/htmltalparser.py21
-rw-r--r--tox.ini2
6 files changed, 32 insertions, 2 deletions
diff --git a/.travis.yml b/.travis.yml
index cc456fb..e06867a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,9 @@
language: python
sudo: false
+matrix:
+ include:
+ - python: 3.5
+ env: TOXENV=py35
env:
- TOXENV=py26
- TOXENV=py27
diff --git a/CHANGES.rst b/CHANGES.rst
index ad2284c..fd9673a 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -7,6 +7,8 @@ Changes
- Accept and ignore ``i18n:ignore`` and ``i18n:ignore-attributes`` attributes.
For compatibility with other tools (such as ``i18ndude``).
+- Claim support for Python 3.5.
+
4.1.1 (2015-06-05)
------------------
diff --git a/README.rst b/README.rst
index 99e3978..e40e341 100644
--- a/README.rst
+++ b/README.rst
@@ -1,6 +1,10 @@
``zope.tal``
============
+.. image:: https://img.shields.io/pypi/v/zope.tal.svg
+ :target: https://pypi.python.org/pypi/zope.tal/
+ :alt: Latest Version
+
.. image:: https://travis-ci.org/zopefoundation/zope.tal.png?branch=master
:target: https://travis-ci.org/zopefoundation/zope.tal
diff --git a/setup.py b/setup.py
index 93301d8..b87af8e 100644
--- a/setup.py
+++ b/setup.py
@@ -66,6 +66,7 @@ setup(name='zope.tal',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Natural Language :: English',
diff --git a/src/zope/tal/htmltalparser.py b/src/zope/tal/htmltalparser.py
index 46f36a5..c79bbea 100644
--- a/src/zope/tal/htmltalparser.py
+++ b/src/zope/tal/htmltalparser.py
@@ -20,7 +20,26 @@ try:
from HTMLParser import HTMLParser, HTMLParseError
except ImportError:
# Python 3.x
- from html.parser import HTMLParser, HTMLParseError
+ from html.parser import HTMLParser
+ try:
+ from html.parser import HTMLParseError
+ except ImportError:
+ # Python 3.5 removed it, but we need it as a base class
+ # so here's a copy taken from Python 3.4:
+ class HTMLParseError(Exception):
+ def __init__(self, msg, position=(None, None)):
+ assert msg
+ self.msg = msg
+ self.lineno = position[0]
+ self.offset = position[1]
+
+ def __str__(self):
+ result = self.msg
+ if self.lineno is not None:
+ result = result + ", at line %d" % self.lineno
+ if self.offset is not None:
+ result = result + ", column %d" % (self.offset + 1)
+ return result
from zope.tal.taldefs import (ZOPE_METAL_NS, ZOPE_TAL_NS, ZOPE_I18N_NS,
METALError, TALError, I18NError)
diff --git a/tox.ini b/tox.ini
index 09ae62a..f0a2a56 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,6 +1,6 @@
[tox]
envlist =
- py26,py27,py32,py33,py34,pypy,pypy3,coverage
+ py26,py27,py32,py33,py34,py35,pypy,pypy3,coverage
[testenv]
commands =