@@ -185,7 +185,7 @@ def getmultiline(self):
185185 nextline = self .getline ()
186186 line = line + ('\n ' + nextline )
187187 if nextline [:3 ] == code and \
188- nextline [3 :4 ] <> '-' :
188+ nextline [3 :4 ] != '-' :
189189 break
190190 return line
191191
@@ -207,7 +207,7 @@ def getresp(self):
207207 def voidresp (self ):
208208 """Expect a response beginning with '2'."""
209209 resp = self .getresp ()
210- if resp [0 ] <> '2' :
210+ if resp [0 ] != '2' :
211211 raise error_reply , resp
212212 return resp
213213
@@ -277,14 +277,14 @@ def ntransfercmd(self, cmd, rest=None):
277277 if rest is not None :
278278 self .sendcmd ("REST %s" % rest )
279279 resp = self .sendcmd (cmd )
280- if resp [0 ] <> '1' :
280+ if resp [0 ] != '1' :
281281 raise error_reply , resp
282282 else :
283283 sock = self .makeport ()
284284 if rest is not None :
285285 self .sendcmd ("REST %s" % rest )
286286 resp = self .sendcmd (cmd )
287- if resp [0 ] <> '1' :
287+ if resp [0 ] != '1' :
288288 raise error_reply , resp
289289 conn , sockaddr = sock .accept ()
290290 if resp [:3 ] == '150' :
@@ -318,7 +318,7 @@ def login(self, user = '', passwd = '', acct = ''):
318318 resp = self .sendcmd ('USER ' + user )
319319 if resp [0 ] == '3' : resp = self .sendcmd ('PASS ' + passwd )
320320 if resp [0 ] == '3' : resp = self .sendcmd ('ACCT ' + acct )
321- if resp [0 ] <> '2' :
321+ if resp [0 ] != '2' :
322322 raise error_reply , resp
323323 return resp
324324
@@ -384,7 +384,7 @@ def storlines(self, cmd, fp):
384384 while 1 :
385385 buf = fp .readline ()
386386 if not buf : break
387- if buf [- 2 :] <> CRLF :
387+ if buf [- 2 :] != CRLF :
388388 if buf [- 1 ] in CRLF : buf = buf [:- 1 ]
389389 buf = buf + CRLF
390390 conn .send (buf )
@@ -423,7 +423,7 @@ def dir(self, *args):
423423 def rename (self , fromname , toname ):
424424 '''Rename a file.'''
425425 resp = self .sendcmd ('RNFR ' + fromname )
426- if resp [0 ] <> '3' :
426+ if resp [0 ] != '3' :
427427 raise error_reply , resp
428428 return self .voidcmd ('RNTO ' + toname )
429429
@@ -508,15 +508,15 @@ def parse227(resp):
508508 Raises error_proto if it does not contain '(h1,h2,h3,h4,p1,p2)'
509509 Return ('host.addr.as.numbers', port#) tuple.'''
510510
511- if resp [:3 ] <> '227' :
511+ if resp [:3 ] != '227' :
512512 raise error_reply , resp
513513 left = string .find (resp , '(' )
514514 if left < 0 : raise error_proto , resp
515515 right = string .find (resp , ')' , left + 1 )
516516 if right < 0 :
517517 raise error_proto , resp # should contain '(h1,h2,h3,h4,p1,p2)'
518518 numbers = string .split (resp [left + 1 :right ], ',' )
519- if len (numbers ) <> 6 :
519+ if len (numbers ) != 6 :
520520 raise error_proto , resp
521521 host = string .join (numbers [:4 ], '.' )
522522 port = (string .atoi (numbers [4 ]) << 8 ) + string .atoi (numbers [5 ])
@@ -528,9 +528,9 @@ def parse257(resp):
528528 This is a response to a MKD or PWD request: a directory name.
529529 Returns the directoryname in the 257 reply.'''
530530
531- if resp [:3 ] <> '257' :
531+ if resp [:3 ] != '257' :
532532 raise error_reply , resp
533- if resp [3 :5 ] <> ' "' :
533+ if resp [3 :5 ] != ' "' :
534534 return '' # Not compliant to RFC 959, but UNIX ftpd does this
535535 dirname = ''
536536 i = 5
@@ -539,7 +539,7 @@ def parse257(resp):
539539 c = resp [i ]
540540 i = i + 1
541541 if c == '"' :
542- if i >= n or resp [i ] <> '"' :
542+ if i >= n or resp [i ] != '"' :
543543 break
544544 i = i + 1
545545 dirname = dirname + c
0 commit comments