File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,13 +77,20 @@ def open_pathname(pathname):
7777 refno = Res .FSpOpenResFile (pathname , 1 )
7878 except Res .Error , arg :
7979 if arg [0 ] in (- 37 , - 39 ):
80- # No resource fork. We may be on OSX, try to decode
81- # the applesingle file.
82- pathname = _decode ( pathname )
83- if pathname :
80+ # No resource fork. We may be on OSX, and this may be either
81+ # a data-fork based resource file or a AppleSingle file
82+ # from the CVS repository.
83+ try :
8484 refno = Res .FSOpenResourceFile (pathname , u'' , 1 )
85+ except Res .Error , arg :
86+ if arg [0 ] != - 199 :
87+ # -199 is "bad resource map"
88+ raise
8589 else :
86- raise
90+ return refno
91+ # Finally try decoding an AppleSingle file
92+ pathname = _decode (pathname )
93+ refno = Res .FSOpenResourceFile (pathname , u'' , 1 )
8794 return refno
8895
8996def _decode (pathname ):
You can’t perform that action at this time.
0 commit comments