File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -155,9 +155,9 @@ def _open(self) -> None:
155155 msg = "not an IM file"
156156 raise SyntaxError (msg )
157157
158- if s [ - 2 :] == b"\r \n " :
158+ if s . endswith ( b"\r \n " ) :
159159 s = s [:- 2 ]
160- elif s [ - 1 :] == b"\n " :
160+ elif s . endswith ( b"\n " ) :
161161 s = s [:- 1 ]
162162
163163 try :
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ def _open(self) -> None:
5454 self .images = [
5555 path
5656 for path in self .ole .listdir ()
57- if path [1 :] and path [0 ][ - 4 :] == ".ACI" and path [1 ] == "Image"
57+ if path [1 :] and path [0 ]. endswith ( ".ACI" ) and path [1 ] == "Image"
5858 ]
5959
6060 # if we didn't find any images, this is probably not
Original file line number Diff line number Diff line change @@ -67,9 +67,9 @@ def _open(self) -> None:
6767
6868 for _ in range (pal ):
6969 s = self .fp .readline ()
70- if s [ - 2 :] == b"\r \n " :
70+ if s . endswith ( b"\r \n " ) :
7171 s = s [:- 2 ]
72- elif s [ - 1 :] in b"\r \n " :
72+ elif s . endswith (( b"\r " , b" \n ")) :
7373 s = s [:- 1 ]
7474
7575 c = s [1 ]
You can’t perform that action at this time.
0 commit comments