From 8ec2ba96b0d4a16b8179837aa8a80fda31561e87 Mon Sep 17 00:00:00 2001 From: PyYoshi Date: Mon, 17 Oct 2016 14:19:56 +0900 Subject: [PATCH] fix test error --- src/cchardet/_cchardet.pyx | 1 - src/tests/test.py | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/cchardet/_cchardet.pyx b/src/cchardet/_cchardet.pyx index f06bb7e..c17ddff 100644 --- a/src/cchardet/_cchardet.pyx +++ b/src/cchardet/_cchardet.pyx @@ -66,7 +66,6 @@ cdef class Detector: self._detected_charset = '' def feed(self, char *msg): - # TODO: Support py3k cdef int length cdef int result diff --git a/src/tests/test.py b/src/tests/test.py index 8279561..e90c148 100644 --- a/src/tests/test.py +++ b/src/tests/test.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # coding: utf-8 +import sys + from nose.tools import eq_ import cchardet @@ -80,6 +82,10 @@ class TestCChardet(): def test_detector_noresult(self): detector = cchardet.Detector() - detector.feed('0') + if sys.version_info[0] < 3: + zero = '0' + else: + zero = b'0' + detector.feed(zero) eq_(detector.done, False) eq_(detector.result, {'encoding': None, 'confidence': None})