Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d583f3b

Browse files
committed
Merge pull request #2407 from pwuertz/fix_unicode_comp
backend_pgf: fix str/unicode comparison errors
2 parents 7bc19c5 + d604681 commit d583f3b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/matplotlib/backends/backend_pgf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ def get_fontspec():
5252
latex_fontspec = []
5353
texcommand = get_texcommand()
5454

55-
if texcommand is not "pdflatex":
55+
if texcommand != "pdflatex":
5656
latex_fontspec.append("\\usepackage{fontspec}")
5757

58-
if texcommand is not "pdflatex" and rcParams.get("pgf.rcfonts", True):
58+
if texcommand != "pdflatex" and rcParams.get("pgf.rcfonts", True):
5959
# try to find fonts from rc parameters
6060
families = ["serif", "sans-serif", "monospace"]
6161
fontspecs = [r"\setmainfont{%s}", r"\setsansfont{%s}",
@@ -139,7 +139,7 @@ def _font_properties_str(prop):
139139
family = prop.get_family()[0]
140140
if family in families:
141141
commands.append(families[family])
142-
elif family in system_fonts and get_texcommand() is not "pdflatex":
142+
elif family in system_fonts and get_texcommand() != "pdflatex":
143143
commands.append(r"\setmainfont{%s}\rmfamily" % family)
144144
else:
145145
pass # print warning?
@@ -173,7 +173,7 @@ def make_pdf_to_png_converter():
173173
pass
174174
# check for ghostscript
175175
try:
176-
gs = "gs" if sys.platform is not "win32" else "gswin32c"
176+
gs = "gs" if sys.platform != "win32" else "gswin32c"
177177
check_output([gs, "-v"], stderr=subprocess.STDOUT)
178178
tools_available.append("gs")
179179
except:

0 commit comments

Comments
 (0)