From b1c884003aacd7156c6f38ba00d085d3ceaa8025 Mon Sep 17 00:00:00 2001 From: mozillazg Date: Wed, 17 Jun 2015 07:25:40 +0800 Subject: [PATCH] fix TypeError: Item in ``from list'' not a string when ``from pypinyin import *``, raise that error --- pypinyin/__init__.py | 2 -- tests/test_others.py | 11 +++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 tests/test_others.py diff --git a/pypinyin/__init__.py b/pypinyin/__init__.py index ed3b64e0..c7f0c5cf 100644 --- a/pypinyin/__init__.py +++ b/pypinyin/__init__.py @@ -3,8 +3,6 @@ """汉语拼音转换工具.""" -from __future__ import unicode_literals - __title__ = 'pypinyin' __version__ = '0.6.0' __author__ = 'mozillazg, 闲耘' diff --git a/tests/test_others.py b/tests/test_others.py new file mode 100644 index 00000000..bffb6913 --- /dev/null +++ b/tests/test_others.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + + +def test_import_all(): + from pypinyin import * # noqa + pinyin('啦啦啦') + pinyin('啦啦啦', TONE2) + lazy_pinyin('啦啦啦') + slug('啦啦啦')