Commits

Barry Warsaw  committed 9195d89

Slightly different way to default to curdir.

  • Participants
  • Parent commits 4f79ed3

Comments (0)

Files changed (1)

File sphinx/setup_command.py

         self.config_dir = None
 
     def _guess_source_dir(self):
-        for guess in ('doc', 'docs', '.'):
+        for guess in ('doc', 'docs'):
             if not os.path.isdir(guess):
                 continue
             for root, dirnames, filenames in os.walk(guess):
                 if 'conf.py' in filenames:
                     return root
+        return None
 
     def finalize_options(self):
         if self.source_dir is None:
             self.source_dir = self._guess_source_dir()
             self.announce('Using source directory %s' % self.source_dir)
         self.ensure_dirname('source_dir')
+        if self.source_dir is None:
+            self.source_dir = os.curdir
         self.source_dir = os.path.abspath(self.source_dir)
         if self.config_dir is None:
             self.config_dir = self.source_dir