]> git.phdru.name Git - m_lib.git/blobdiff - m_lib/net/ftp/ftpscan.py
Use print function for Py3 compatibility
[m_lib.git] / m_lib / net / ftp / ftpscan.py
index 319660be9d2147c8090f86dd69dd1daa32b9cfe6..5eeb1d2be4a813baad7fa0a6eed4f619c1200b30 100755 (executable)
@@ -2,6 +2,7 @@
 """Recursive FTP scanners"""
 
 
+from __future__ import print_function
 import ftplib
 from m_lib.net.ftp.ftpparse import ftpparse
 
@@ -217,7 +218,7 @@ def test(ftp_server, func, passive=None, reconnect=False):
    tree = func(ftp_server, passive=passive, reconnect=reconnect)
 
    stop_time = time()
-   print stop_time - start_time
+   print(stop_time - start_time)
 
    logfname = "%s.list" % ftp_server
    log = open(logfname, 'w')
@@ -268,16 +269,16 @@ if __name__ == "__main__":
    else:
       ftp_server = arguments[0]
 
-   print "Scanning", ftp_server
+   print("Scanning", ftp_server)
    try:
       test(ftp_server, ftpscanrecursive, passive)
    except FtpScanError, msg:
-      print "Rescanning due to the error:", msg
+      print("Rescanning due to the error:", msg)
       try:
          test(ftp_server, ftpscan1, passive)
       except EOFError:
-         print "Rescanning due to the error: connection reset by peer"
+         print("Rescanning due to the error: connection reset by peer")
          test(ftp_server, ftpscan1, passive, True)
    except EOFError:
-      print "Rescanning due to the error: connection reset by peer"
+      print("Rescanning due to the error: connection reset by peer")
       test(ftp_server, ftpscan1, passive, True)