File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import sys
12import time
23
34from datetime import datetime
45
6+ #: Running under Python 3
7+ PY3K = sys .version_info [0 ] == 3 and True or False
8+
9+
510GITHUB_TIMEZONE = "-0700"
611GITHUB_DATE_FORMAT = "%Y/%m/%d %H:%M:%S"
712#2009-03-21T18:01:48-07:00
@@ -294,4 +299,6 @@ def repr_string(string):
294299 """
295300 if len (string ) > 20 :
296301 string = string [:17 ] + '...'
297- return string .encode ('utf-8' )
302+ if not PY3K :
303+ string .decode ('utf-8' )
304+ return string
Original file line number Diff line number Diff line change 33import _setup
44
55import datetime
6- import sys
76import unittest
87
98from nose .tools import (assert_equals , assert_true )
@@ -21,8 +20,6 @@ class ReprTests(unittest.TestCase):
2120 def test_issue (self ):
2221 """Issues can have non-ASCII characters in the title."""
2322 title = 'abcdé'
24- if sys .version_info [0 ] == 2 :
25- title = title .decode ("utf-8" )
2623 i = Issue (title = title )
2724 assert_equals (str , type (repr (i )))
2825
You can’t perform that action at this time.
0 commit comments