Skip to content

Commit

Permalink
vpython: capture: use endswith instead of slicing
Browse files Browse the repository at this point in the history
  • Loading branch information
0dminnimda committed Jul 21, 2021
1 parent 00dd16d commit 2eb3511
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vpython/vpython.py
Original file line number Diff line number Diff line change
Expand Up @@ -3142,7 +3142,7 @@ def capture(self, filename, capture_labels=True):
if not isinstance(filename, str):
raise TypeError("'filename' for Capture must be a string.")

if filename[-4:] != ".png":
if filename.endswith(".png"):
filename += ".png"

include_labels = "T" if capture_labels else "F"
Expand Down

0 comments on commit 2eb3511

Please sign in to comment.