Skip to content

Commit ac18a1e

Browse files
committed
Merge pull request #19 from alimanfoo/py2
Resolves #19.
2 parents b9967e8 + c00da7d commit ac18a1e

File tree

4 files changed

+34
-2
lines changed

4 files changed

+34
-2
lines changed

requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
cython
2+
numpy
3+
fasteners

tox.ini

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Tox (http://tox.testrun.org/) is a tool for running tests
2+
# in multiple virtualenvs. This configuration file will run the
3+
# test suite on all supported python versions. To use it, "pip install tox"
4+
# and then run "tox" from this directory.
5+
6+
[tox]
7+
envlist = py27, py34, py35
8+
9+
[testenv]
10+
setenv =
11+
PYTHONHASHSEED = 42
12+
commands =
13+
python setup.py build_ext --inplace
14+
nosetests -v --stop
15+
deps =
16+
nose
17+
setuptools
18+
setuptools_scm
19+
-rrequirements.txt

zarr/compat.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# -*- coding: utf-8 -*-
2+
from __future__ import absolute_import, print_function, division
3+
4+
5+
import sys
6+
7+
8+
PY2 = sys.version_info[0] == 2
9+
10+
if PY2:
11+
pass

zarr/ext.pyx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from __future__ import absolute_import, print_function, division
77
from threading import RLock
88
import itertools
9-
# TODO PY2 compatibility
109
from functools import reduce
1110
import operator
1211
import sys
@@ -531,7 +530,7 @@ cdef class PersistentChunk(BaseChunk):
531530

532531
# move temporary file into place
533532
if temp_path is not None:
534-
os.replace(temp_path, self._path)
533+
os.rename(temp_path, self._path)
535534

536535
cdef void put(self, char *source):
537536
cdef:

0 commit comments

Comments
 (0)