]> git.pld-linux.org Git - projects/pld-ftp-admin.git/blobdiff - modules/cmds.py
Fix exception handling syntax (python3 compat)
[projects/pld-ftp-admin.git] / modules / cmds.py
index 6a71c13436e771838501f5d4bab3ccf1ab61097f..d82b35aa2d30c5e37e5eeb4ff2e2ab1a31ca7dbe 100644 (file)
@@ -17,7 +17,7 @@ def parse(con):
         con.data=con.data[len(cmd)+1:]
         cmdname=cmd[:4]
         if not con.authorized and cmdname not in ('linp', 'linc', 'name'):
-            raise BailOut
+            raise BailOut()
             # TODO: log unauthorized access
         if cmdname in cmdlist_noargs:
             if len(cmd)==4:
@@ -32,7 +32,7 @@ def parse(con):
                 pass
                 # TODO: log malicious msg
         else:
-            raise BailOut
+            raise BailOut()
             # TODO: log this
 
 def lock(con, arg, hard):
@@ -112,7 +112,7 @@ def write_cookies():
 def cmd_login_passwd(con, data):
     tmp=data.split('\n')
     if len(tmp)!=2:
-        raise BailOut
+        raise BailOut()
     login=tmp[0]
     passwd=tmp[1]
     md5pass=md5.new(passwd).hexdigest()
@@ -126,7 +126,7 @@ def cmd_login_passwd(con, data):
     else:
         # TODO: log this
         con.sock.send('FAIL')
-        raise BailOut
+        raise BailOut()
 
 def cmd_login_cookie(con, cookie):
     if cookie in cookies:
This page took 0.078678 seconds and 4 git commands to generate.