]> arthur.barton.de Git - bup.git/blobdiff - cmd/ftp-cmd.py
cmd/ftp: don't die if we can't import the ctypes module.
[bup.git] / cmd / ftp-cmd.py
index 253b7acffc20c553f1e9ddb24e77481b87295810..f103a61f3867e344b6c3330d8cf09366202004f6 100755 (executable)
@@ -3,6 +3,9 @@ import sys, os, re, stat, fnmatch
 from bup import options, git, shquote, vfs
 from bup.helpers import *
 
+handle_ctrl_c()
+
+
 def node_name(text, n):
     if stat.S_ISDIR(n.mode):
         return '%s/' % text
@@ -94,7 +97,13 @@ def find_readline_lib():
 def init_readline_vars():
     """Work around trailing space automatically inserted by readline.
     See http://bugs.python.org/issue5833"""
-    import ctypes
+    try:
+        import ctypes
+    except ImportError:
+        # python before 2.5 didn't have the ctypes module; but those
+        # old systems probably also didn't have this readline bug, so
+        # just ignore it.
+        return
     lib_name = find_readline_lib()
     if lib_name is not None:
         lib = ctypes.cdll.LoadLibrary(lib_name)