FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Use unicode_literals for Py2 compatibility · ppannuto/python-titlecase@0d83ac5 · GitHub

Repository navigation

Commit 0d83ac5

Browse files
committed
Use unicode_literals for Py2 compatibility
Ensure all strings in py2 are unicode which allow detection of unicode punctuation characters before a word. Fixes #31
1 parent 6b1665f commit 0d83ac5

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

‎titlecase/__init__.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
License: http://www.opensource.org/licenses/mit-license.php
88
"""
99

10+
from __future__ import unicode_literals
11+
1012
import argparse
1113
import re
1214
import sys

‎titlecase/tests.py‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
"""Tests for titlecase"""
55

6-
from __future__ import print_function
6+
from __future__ import print_function, unicode_literals
77

88
import os
99
import sys
@@ -251,6 +251,14 @@
251251
(
252252
"mcfoo-bar, MCFOO-BAR, McFoo-bar, McFoo-Bar, mcfoo-mcbar, foo-mcbar",
253253
"McFoo-Bar, McFoo-Bar, McFoo-Bar, McFoo-Bar, McFoo-McBar, Foo-McBar",
254+
),
255+
(
256+
"'QUOTE' A GREAT",
257+
"'Quote' a Great",
258+
),
259+
(
260+
"‘QUOTE’ A GREAT",
261+
"‘Quote’ a Great",
254262
)
255263
)
256264

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL