Skip to content

Commit 2eb3511

Browse files
committed
vpython: capture: use endswith instead of slicing
1 parent 00dd16d commit 2eb3511

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

vpython/vpython.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3142,7 +3142,7 @@ def capture(self, filename, capture_labels=True):
31423142
if not isinstance(filename, str):
31433143
raise TypeError("'filename' for Capture must be a string.")
31443144

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

31483148
include_labels = "T" if capture_labels else "F"

0 commit comments

Comments
 (0)