Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LaTeX drawer on split-filesystem systems #8629

Merged
merged 4 commits into from
Aug 29, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion qiskit/visualization/circuit_visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,8 @@ def _latex_circuit_drawer(
image = utils._trim(image)
if filename:
if filename.endswith(".pdf"):
os.rename(base + ".pdf", filename)
import shutil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import can go to the top of the file with the rest (I was just trying simplify the description of the change when I was asking you to try it out, sorry).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, good point. I moved it.

shutil.move(base + ".pdf", filename)
else:
try:
image.save(filename)
Expand Down