8000 backend_pgf: fix str/unicode comparison errors (v1.3.x) · matplotlib/matplotlib@a868b09 · GitHub
[go: up one dir, main page]

Skip to content

Commit a868b09

Browse files
committed
backend_pgf: fix str/unicode comparison errors (v1.3.x)
1 parent 2449199 commit a868b09

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/matplotlib/backends/backend_pgf.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ def get_fontspec():
5050
latex_fontspec = []
5151
texcommand = get_texcommand()
5252

53-
if texcommand is not "pdflatex":
53+
if texcommand != "pdflatex":
5454
latex_fontspec.append(r"\usepackage{fontspec}")
5555

56-
if texcommand is not "pdflatex" and rcParams.get("pgf.rcfonts", True):
56+
if texcommand != "pdflatex" and rcParams.get("pgf.rcfonts", True):
5757
# try to find fonts from rc parameters
5858
families = ["serif", "sans-serif", "monospace"]
5959
fontspecs = [r"\setmainfont{%s}", r"\setsansfont{%s}",
@@ -137,7 +137,7 @@ def _font_properties_str(prop):
137137
family = prop.get_family()[0]
138138
if family in families:
139139
commands.append(families[family])
140-
elif family in system_fonts and get_texcommand() is not "pdflatex":
140+
elif family in system_fonts and get_texcommand() != "pdflatex":
141141
commands.append(r"\setmainfont{%s}\rmfamily" % family)
142142
else:
143143
pass # print warning?
@@ -171,7 +171,7 @@ def make_pdf_to_png_converter():
171171
pass
172172
# check for ghostscript
173173
try:
174-
gs = "gs" if sys.platform is not "win32" else "gswin32c"
174+
gs = "gs" if sys.platform != "win32" else "gswin32c"
175175
check_output([gs, "-v"], stderr=subprocess.STDOUT)
176176
tools_available.append("gs")
177177
except:
@@ -215,11 +215,11 @@ def get_latex_manager():
215215
# check if the previous instance of LatexManager can be reused
216216
if prev and prev.latex_header == latex_header and prev.texcommand == texcommand:
217217
if rcParams.get("pgf.debug", False):
218-
print "reusing LatexManager"
218+
print("reusing LatexManager")
219219
return prev
220220
else:
221221
if rcParams.get("pgf.debug", False):
222-
print "creating LatexManager"
222+
print("creating LatexManager")
223223
new_inst = LatexManager()
224224
LatexManagerFactory.previous_instance = new_inst
225225
return new_inst
@@ -340,7 +340,7 @@ def _cleanup(self):
340340

341341
def __del__(self):
342342
if rcParams.get("pgf.debug", False):
343-
print "deleting LatexManager"
343+
print("deleting LatexManager")
344344
self._cleanup()
345345

346346
def get_width_height_descent(self, text, prop):

0 commit comments

Comments
 (0)
0