Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Note explicit support for Python 3.5 #5

Merged
merged 2 commits into from
Nov 13, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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