Skip to content

Commit c65c14d

Browse files
authored
Merge pull request #10907 from anntzer/unicodestrings
MNT: No need to mark (unicode) strings as u"foo" anymore.
2 parents 0043d9a + 130cba0 commit c65c14d

File tree

6 files changed

+13
-17
lines changed

6 files changed

+13
-17
lines changed

lib/matplotlib/_mathtext_data.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@
281281
r'\rho' : ('psyr', 114),
282282
r'\sigma' : ('psyr', 115),
283283
r'\tau' : ('psyr', 116),
284-
'\\upsilon' : ('psyr', 117),
284+
r'\upsilon' : ('psyr', 117),
285285
r'\varpi' : ('psyr', 118),
286286
r'\omega' : ('psyr', 119),
287287
r'\xi' : ('psyr', 120),
@@ -296,7 +296,7 @@
296296
r'\spadesuit' : ('psyr', 170),
297297
r'\leftrightarrow' : ('psyr', 171),
298298
r'\leftarrow' : ('psyr', 172),
299-
'\\uparrow' : ('psyr', 173),
299+
r'\uparrow' : ('psyr', 173),
300300
r'\rightarrow' : ('psyr', 174),
301301
r'\downarrow' : ('psyr', 175),
302302
r'\pm' : ('psyr', 176),
@@ -335,12 +335,12 @@
335335
r'\surd' : ('psyr', 214),
336336
r'\__sqrt__' : ('psyr', 214),
337337
r'\cdot' : ('psyr', 215),
338-
'\\urcorner' : ('psyr', 216),
338+
r'\urcorner' : ('psyr', 216),
339339
r'\vee' : ('psyr', 217),
340340
r'\wedge' : ('psyr', 218),
341341
r'\Leftrightarrow' : ('psyr', 219),
342342
r'\Leftarrow' : ('psyr', 220),
343-
'\\Uparrow' : ('psyr', 221),
343+
r'\Uparrow' : ('psyr', 221),
344344
r'\Rightarrow' : ('psyr', 222),
345345
r'\Downarrow' : ('psyr', 223),
346346
r'\Diamond' : ('psyr', 224),
@@ -362,7 +362,7 @@
362362
r'\slash' : ('psyr', 0o57),
363363
r'\Lamda' : ('psyr', 0o114),
364364
r'\neg' : ('psyr', 0o330),
365-
'\\Upsilon' : ('psyr', 0o241),
365+
r'\Upsilon' : ('psyr', 0o241),
366366
r'\rightbrace' : ('psyr', 0o175),
367367
r'\rfloor' : ('psyr', 0o373),
368368
r'\lambda' : ('psyr', 0o154),

lib/matplotlib/tests/test_arrow_patches.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def __prepare_fancyarrow_dpi_cor_test():
6262
ax.set_xlim([0, 1])
6363
ax.set_ylim([0, 1])
6464
ax.add_patch(mpatches.FancyArrowPatch(posA=(0.3, 0.4), posB=(0.8, 0.6),
65-
lw=3, arrowstyle=u'->',
65+
lw=3, arrowstyle='->',
6666
mutation_scale=100))
6767
return fig2
6868

lib/matplotlib/tests/test_backend_pdf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def test_use14corefonts():
2828
rcParams['font.sans-serif'] = ['Helvetica']
2929
rcParams['pdf.compression'] = 0
3030

31-
text = u'''A three-line text positioned just above a blue line
31+
text = '''A three-line text positioned just above a blue line
3232
and containing some French characters and the euro symbol:
3333
"Merci pépé pour les 10 €"'''
3434

lib/matplotlib/tests/test_mathtext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
# mathtex doesn't support array
8787
# 'mmltt23' : r'$\left(\begin{array}{cc}\hfill \left(\begin{array}{cc}\hfill a\hfill & \hfill b\hfill \\ \hfill c\hfill & \hfill d\hfill \end{array}\right)\hfill & \hfill \left(\begin{array}{cc}\hfill e\hfill & \hfill f\hfill \\ \hfill g\hfill & \hfill h\hfill \end{array}\right)\hfill \\ \hfill 0\hfill & \hfill \left(\begin{array}{cc}\hfill i\hfill & \hfill j\hfill \\ \hfill k\hfill & \hfill l\hfill \end{array}\right)\hfill \end{array}\right)$',
8888
# mathtex doesn't support array
89-
# 'mmltt24' : u'$det|\\begin{array}{ccccc}\\hfill {c}_{0}\\hfill & \\hfill {c}_{1}\\hfill & \\hfill {c}_{2}\\hfill & \\hfill \\dots \\hfill & \\hfill {c}_{n}\\hfill \\\\ \\hfill {c}_{1}\\hfill & \\hfill {c}_{2}\\hfill & \\hfill {c}_{3}\\hfill & \\hfill \\dots \\hfill & \\hfill {c}_{n+1}\\hfill \\\\ \\hfill {c}_{2}\\hfill & \\hfill {c}_{3}\\hfill & \\hfill {c}_{4}\\hfill & \\hfill \\dots \\hfill & \\hfill {c}_{n+2}\\hfill \\\\ \\hfill \\u22ee\\hfill & \\hfill \\u22ee\\hfill & \\hfill \\u22ee\\hfill & \\hfill \\hfill & \\hfill \\u22ee\\hfill \\\\ \\hfill {c}_{n}\\hfill & \\hfill {c}_{n+1}\\hfill & \\hfill {c}_{n+2}\\hfill & \\hfill \\dots \\hfill & \\hfill {c}_{2n}\\hfill \\end{array}|>0$',
89+
# 'mmltt24' : r'$det|\begin{array}{ccccc}\hfill {c}_{0}\hfill & \hfill {c}_{1}\hfill & \hfill {c}_{2}\hfill & \hfill \dots \hfill & \hfill {c}_{n}\hfill \\ \hfill {c}_{1}\hfill & \hfill {c}_{2}\hfill & \hfill {c}_{3}\hfill & \hfill \dots \hfill & \hfill {c}_{n+1}\hfill \\ \hfill {c}_{2}\hfill & \hfill {c}_{3}\hfill & \hfill {c}_{4}\hfill & \hfill \dots \hfill & \hfill {c}_{n+2}\hfill \\ \hfill \u22ee\hfill & \hfill \u22ee\hfill & \hfill \u22ee\hfill & \hfill \hfill & \hfill \u22ee\hfill \\ \hfill {c}_{n}\hfill & \hfill {c}_{n+1}\hfill & \hfill {c}_{n+2}\hfill & \hfill \dots \hfill & \hfill {c}_{2n}\hfill \end{array}|>0$',
9090
r'${y}_{{x}_{2}}$',
9191
r'${x}_{92}^{31415}+\pi $',
9292
r'${x}_{{y}_{b}^{a}}^{{z}_{c}^{d}}$',

lib/matplotlib/type1font.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def fontmatrix(array):
275275
newmatrix = np.dot(modifier, oldmatrix)
276276
array[::2] = newmatrix[0:3, 0]
277277
array[1::2] = newmatrix[0:3, 1]
278-
as_string = u'[' + u' '.join(str(x) for x in array) + u']'
278+
as_string = '[' + ' '.join(str(x) for x in array) + ']'
279279
return as_string.encode('latin-1')
280280

281281
def replace(fun):

tools/github_stats.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,21 +99,17 @@ def report(issues, show_urls=False):
9999
if show_urls:
100100
for i in issues:
101101
role = 'ghpull' if 'merged_at' in i else 'ghissue'
102-
print(u'* :%s:`%d`: %s' % (role, i['number'],
103-
i['title'].replace(u'`', u'``')))
102+
print('* :%s:`%d`: %s' % (role, i['number'],
103+
i['title'].replace('`', '``')))
104104
else:
105105
for i in issues:
106-
print(u'* %d: %s' % (i['number'], i['title'].replace(u'`', u'``')))
106+
print('* %d: %s' % (i['number'], i['title'].replace('`', '``')))
107107

108108
#-----------------------------------------------------------------------------
109109
# Main script
110110
#-----------------------------------------------------------------------------
111111

112112
if __name__ == "__main__":
113-
# deal with unicode
114-
if sys.version_info < (3,):
115-
sys.stdout = codecs.getwriter('utf8')(sys.stdout)
116-
117113
# Whether to add reST urls for all issues in printout.
118114
show_urls = True
119115

@@ -211,7 +207,7 @@ def report(issues, show_urls=False):
211207
ncommits = len(pr_authors) + ncommits - len(pulls)
212208
author_cmd = ['git', 'check-mailmap'] + pr_authors
213209
with_email = check_output(author_cmd).decode('utf-8', 'replace').splitlines()
214-
all_authors.extend([ u'* ' + a.split(' <')[0] for a in with_email ])
210+
all_authors.extend(['* ' + a.split(' <')[0] for a in with_email])
215211
unique_authors = sorted(set(all_authors), key=lambda s: s.lower())
216212

217213
print("We closed %d issues and merged %d pull requests." % (n_issues, n_pulls))

0 commit comments

Comments
 (0)