]> granicus.if.org Git - python/commitdiff
Fixed to run better in unix-Python, and to cater for bgenlocations
authorJack Jansen <jack.jansen@cwi.nl>
Mon, 5 Aug 2002 15:32:30 +0000 (15:32 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Mon, 5 Aug 2002 15:32:30 +0000 (15:32 +0000)
possibly being missing.

Tools/bgen/bgen/scantools.py

index d5dc2afd5acb04793546099bdab004b50fbf7b26..5efa6fc04a805d3dc5469708818b972312a6730d 100644 (file)
@@ -25,7 +25,11 @@ try:
 except ImportError:
        MacOS = None
 
-from bgenlocations import CREATOR, INCLUDEDIR
+try:
+       from bgenlocations import CREATOR, INCLUDEDIR
+except ImportError:
+       CREATOR = None
+       INCLUDEDIR = os.curdir
 
 Error = "scantools.Error"
 
@@ -236,7 +240,7 @@ if missing: raise "Missing Types"
                self.line = ""
 
        def initpaths(self):
-               self.includepath = [':', INCLUDEDIR]
+               self.includepath = [os.curdir, INCLUDEDIR]
 
        def initpatterns(self):
                self.head_pat = r"^EXTERN_API[^_]"
@@ -263,7 +267,7 @@ if missing: raise "Missing Types"
                                setattr(self, name[:-4], prog)
 
        def initosspecifics(self):
-               if MacOS:
+               if MacOS and CREATOR:
                        self.filetype = 'TEXT'
                        self.filecreator = CREATOR
                else: