Commits

Ali Gholami Rudi  committed ced6a7e

fscommands: not failing when git is not available

  • Participants
  • Parent commits efd5617

Comments (0)

Files changed (1)

File rope/base/fscommands.py

         if key in dirlist:
             try:
                 return commands[key](root)
-            except ImportError:
+            except (ImportError, OSError):
                 pass
     return FileSystemCommands()
 
 
     def __init__(self, root):
         self.root = root
+        self._do(['version'])
         self.normal_actions = FileSystemCommands()
 
     def create_file(self, path):
 def _execute(args, cwd=None):
     process = subprocess.Popen(args, cwd=cwd, stdout=subprocess.PIPE)
     process.wait()
+    return process.returncode
 
 
 def unicode_to_file_data(contents, encoding=None):