-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from hybridcluster/python3-1
Python 3.3 support. Fixes #1.
- Loading branch information
Showing
24 changed files
with
157 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
language: python | ||
|
||
env: | ||
- TWISTED=Twisted RUNTESTS=trial | ||
|
||
python: | ||
- 2.7 | ||
- pypy | ||
|
||
matrix: | ||
include: | ||
- python: 3.3 | ||
env: TWISTED=git+https://github.com/twisted/twisted.git RUNTESTS="python -m unittest discover" | ||
|
||
|
||
install: | ||
- python setup.py --version | ||
- pip install -q -r requirements-dev.txt | ||
- pip install -q $TWISTED --use-mirrors | ||
- python setup.py -q install | ||
|
||
script: trial eliot.tests | ||
script: $RUNTESTS eliot.tests | ||
|
||
notifications: | ||
email: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ Contents: | |
fields | ||
threads | ||
development | ||
news | ||
:maxdepth: 2 | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
What's New | ||
========== | ||
|
||
0.4.0 | ||
^^^^^ | ||
|
||
Features: | ||
|
||
* Added support for Python 3.3. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
""" | ||
Python 3 JSON encoding/decoding, emulating Python 2's json module. | ||
Python 3 json module doesn't support decoding bytes or encoding. Rather than | ||
adding isinstance checks in main code path which would slow down Python 2, | ||
instead we write our encoder that can support those. | ||
""" | ||
|
||
import json as pyjson | ||
|
||
|
||
class JSONEncoder(pyjson.JSONEncoder): | ||
""" | ||
JSON encoder that supports L{bytes}. | ||
""" | ||
def default(self, o): | ||
if isinstance(o, bytes): | ||
return o.decode("utf-8") | ||
return pyjson.JSONEncoder.default(self, o) | ||
|
||
_encoder = JSONEncoder() | ||
|
||
|
||
|
||
def loads(s): | ||
if isinstance(s, bytes): | ||
s = s.decode("utf-8") | ||
return pyjson.loads(s) | ||
|
||
|
||
|
||
def dumps(obj): | ||
return _encoder.encode(obj).encode("utf-8") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ | |
|
||
from __future__ import unicode_literals | ||
|
||
from six import text_type as unicode | ||
|
||
|
||
def safeunicode(o): | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.