Skip to content

Commit

Permalink
No need to mark (unicode) strings as u"foo" anymore.
Browse files Browse the repository at this point in the history
  • Loading branch information
anntzer committed Mar 28, 2018
1 parent 0d0eb39 commit 130cba0
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 17 deletions.
10 changes: 5 additions & 5 deletions lib/matplotlib/_mathtext_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
r'\rho' : ('psyr', 114),
r'\sigma' : ('psyr', 115),
r'\tau' : ('psyr', 116),
'\\upsilon' : ('psyr', 117),
r'\upsilon' : ('psyr', 117),
r'\varpi' : ('psyr', 118),
r'\omega' : ('psyr', 119),
r'\xi' : ('psyr', 120),
Expand All @@ -296,7 +296,7 @@
r'\spadesuit' : ('psyr', 170),
r'\leftrightarrow' : ('psyr', 171),
r'\leftarrow' : ('psyr', 172),
'\\uparrow' : ('psyr', 173),
r'\uparrow' : ('psyr', 173),
r'\rightarrow' : ('psyr', 174),
r'\downarrow' : ('psyr', 175),
r'\pm' : ('psyr', 176),
Expand Down Expand Up @@ -335,12 +335,12 @@
r'\surd' : ('psyr', 214),
r'\__sqrt__' : ('psyr', 214),
r'\cdot' : ('psyr', 215),
'\\urcorner' : ('psyr', 216),
r'\urcorner' : ('psyr', 216),
r'\vee' : ('psyr', 217),
r'\wedge' : ('psyr', 218),
r'\Leftrightarrow' : ('psyr', 219),
r'\Leftarrow' : ('psyr', 220),
'\\Uparrow' : ('psyr', 221),
r'\Uparrow' : ('psyr', 221),
r'\Rightarrow' : ('psyr', 222),
r'\Downarrow' : ('psyr', 223),
r'\Diamond' : ('psyr', 224),
Expand All @@ -362,7 +362,7 @@
r'\slash' : ('psyr', 0o57),
r'\Lamda' : ('psyr', 0o114),
r'\neg' : ('psyr', 0o330),
'\\Upsilon' : ('psyr', 0o241),
r'\Upsilon' : ('psyr', 0o241),
r'\rightbrace' : ('psyr', 0o175),
r'\rfloor' : ('psyr', 0o373),
r'\lambda' : ('psyr', 0o154),
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/tests/test_arrow_patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def __prepare_fancyarrow_dpi_cor_test():
ax.set_xlim([0, 1])
ax.set_ylim([0, 1])
ax.add_patch(mpatches.FancyArrowPatch(posA=(0.3, 0.4), posB=(0.8, 0.6),
lw=3, arrowstyle=u'->',
lw=3, arrowstyle='->',
mutation_scale=100))
return fig2

Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/tests/test_backend_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_use14corefonts():
rcParams['font.sans-serif'] = ['Helvetica']
rcParams['pdf.compression'] = 0

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

Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/tests/test_mathtext.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
# mathtex doesn't support array
# '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)$',
# mathtex doesn't support array
# '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$',
# '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$',
r'${y}_{{x}_{2}}$',
r'${x}_{92}^{31415}+\pi $',
r'${x}_{{y}_{b}^{a}}^{{z}_{c}^{d}}$',
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/type1font.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def fontmatrix(array):
newmatrix = np.dot(modifier, oldmatrix)
array[::2] = newmatrix[0:3, 0]
array[1::2] = newmatrix[0:3, 1]
as_string = u'[' + u' '.join(str(x) for x in array) + u']'
as_string = '[' + ' '.join(str(x) for x in array) + ']'
return as_string.encode('latin-1')

def replace(fun):
Expand Down
12 changes: 4 additions & 8 deletions tools/github_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,17 @@ def report(issues, show_urls=False):
if show_urls:
for i in issues:
role = 'ghpull' if 'merged_at' in i else 'ghissue'
print(u'* :%s:`%d`: %s' % (role, i['number'],
i['title'].replace(u'`', u'``')))
print('* :%s:`%d`: %s' % (role, i['number'],
i['title'].replace('`', '``')))
else:
for i in issues:
print(u'* %d: %s' % (i['number'], i['title'].replace(u'`', u'``')))
print('* %d: %s' % (i['number'], i['title'].replace('`', '``')))

#-----------------------------------------------------------------------------
# Main script
#-----------------------------------------------------------------------------

if __name__ == "__main__":
# deal with unicode
if sys.version_info < (3,):
sys.stdout = codecs.getwriter('utf8')(sys.stdout)

# Whether to add reST urls for all issues in printout.
show_urls = True

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

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

0 comments on commit 130cba0

Please sign in to comment.