Changeset 520

Show
Ignore:
Timestamp:
Mon Aug 4 12:35:19 2008
Author:
htgoebel
Message:

Fixed some bugs introduced in r512.

Files:

Legend:

Unmodified
Added
Removed
Modified
  • trunk/mf.py

    r512 r520  
    28 28 import suffixes  
    29 29  
      30 try:  
      31     STRINGTYPE = basestring  
      32 except NameError:  
      33     STRINGTYPE = type("")  
    30 34  
    31 35 if not os.environ.has_key('PYTHONCASEOK') and sys.version_info >= (2, 1):  
  • trunk/iu.py

    r512 r520  
    263 263         mod = None  
    264 264         for thing in self.path:  
    265               if type(thing) is STRINGTYPE:  
      265             if isinstance(thing, STRINGTYPE):  
    265 265                 owner = self.shadowpath.get(thing, -1)  
    266 266                 if owner == -1:  
     
    556 556     global _os_stat, _os_path_join, _os_path_dirname, _os_getcwd  
    557 557  
    558       def join(a, b, sep=sep):  
    559           if a == '':  
    560               return b  
    561           lastchar = a[-1:]  
    562           if lastchar == '/' or lastchar == sep:  
    563               return a + b  
    564           return a + sep + b  
    565    
    566       def dirname(a, sep=sep, mindirlen=mindirlen):  
    567           for i in range(len(a)-1, -1, -1):  
    568               c = a[i]  
    569               if c == '/' or c == sep:  
    570                   if i < mindirlen:  
    571                       return a[:i+1]  
    572                   return a[:i]  
    573           return ''  
    574    
    575 558     names = sys.builtin_module_names  
    576 559  
     
    594 577     elif 'mac' in names:  
    595 578         from mac import stat, getcwd  
    596           # overwrite join():  
    597 579         def join(a, b):  
    598 580             if a == '':  
     
    607 589         raise ImportError, 'no os specific module found'  
    608 590  
      591     if join is None:  
      592         def join(a, b, sep=sep):  
      593             if a == '':  
      594                 return b  
      595             lastchar = a[-1:]  
      596             if lastchar == '/' or lastchar == sep:  
      597                 return a + b  
      598             return a + sep + b  
      599  
      600     if dirname is None:  
      601         def dirname(a, sep=sep, mindirlen=mindirlen):  
      602             for i in range(len(a)-1, -1, -1):  
      603                 c = a[i]  
      604                 if c == '/' or c == sep:  
      605                     if i < mindirlen:  
      606                         return a[:i+1]  
      607                     return a[:i]  
      608             return ''  
      609  
    609 610     _os_stat = stat  
    610 611     _os_getcwd = getcwd