Skip to content

Commit

Permalink
Merge pull request #5 from felixonmars/master
Browse files Browse the repository at this point in the history
Note explicit support for Python 3.5
  • Loading branch information
mgedmin committed Nov 13, 2015
2 parents 3e48d6c + ab99c4d commit 65009b2
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
@@ -1,5 +1,9 @@
language: python
sudo: false
matrix:
include:
- python: 3.5
env: TOXENV=py35
env:
- TOXENV=py26
- TOXENV=py27
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.rst
Expand Up @@ -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)
------------------

Expand Down
4 changes: 4 additions & 0 deletions 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

Expand Down
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -66,6 +66,7 @@ def alltests():
'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',
Expand Down
21 changes: 20 additions & 1 deletion src/zope/tal/htmltalparser.py
Expand Up @@ -20,7 +20,26 @@
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)
Expand Down
2 changes: 1 addition & 1 deletion 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 =
Expand Down

0 comments on commit 65009b2

Please sign in to comment.