Skip to content

Commit 58fc4de

Browse files
authored
Merge pull request #1 from jgoret/master
Python 3 compatibility
2 parents c5451ab + 153d789 commit 58fc4de

File tree

4 files changed

+33
-8
lines changed

4 files changed

+33
-8
lines changed

.travis.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
sudo: false
2+
language: python
3+
4+
python:
5+
- "2.6"
6+
- "2.7"
7+
- "pypy"
8+
- "3.3"
9+
- "3.4"
10+
11+
install:
12+
- pip install pytest-cov
13+
- pip install -e .
14+
15+
script:
16+
- py.test --cov=flask_zodb tests.py
17+
18+
after_success:
19+
- pip install coveralls
20+
- coveralls

README.mkd

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ Flask-ZODB
33

44
![Flask-ZODB][logo]
55

6+
[![Build Status](https://travis-ci.org/Kyah/flask-zodb.svg)](https://travis-ci.org/Kyah/flask-zodb)
7+
[![Coverage Status](https://coveralls.io/repos/Kyah/flask-zodb/badge.svg?branch=master&service=github)](https://coveralls.io/github/Kyah/flask-zodb?branch=master)
8+
69

710
Simple extension for integrating the ZODB in Flask applications.
811

flask_zodb.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
import transaction
33
import zodburi
44

5-
from UserDict import IterableUserDict
5+
try:
6+
from collections import UserDict
7+
except ImportError:
8+
from UserDict import IterableUserDict as UserDict
9+
610
from ZODB.DB import DB
711
from contextlib import contextmanager, closing
812
from werkzeug.utils import cached_property
@@ -12,11 +16,15 @@
1216
from persistent.list import PersistentList as List
1317
from persistent.mapping import PersistentMapping as Dict
1418

19+
try:
20+
basestring
21+
except NameError:
22+
basestring = str
1523

1624
__all__ = ['ZODB', 'Object', 'List', 'Dict', 'BTree']
1725

1826

19-
class ZODB(IterableUserDict):
27+
class ZODB(UserDict):
2028
"""Extension object. Behaves as the root object of the storage during
2129
requests, i.e. a `~persistent.mapping.PersistentMapping`.
2230

tox.ini

-6
This file was deleted.

0 commit comments

Comments
 (0)