File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -77,13 +77,20 @@ def open_pathname(pathname):
77
77
refno = Res .FSpOpenResFile (pathname , 1 )
78
78
except Res .Error , arg :
79
79
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 :
84
84
refno = Res .FSOpenResourceFile (pathname , u'' , 1 )
85
+ except Res .Error , arg :
86
+ if arg [0 ] != - 199 :
87
+ # -199 is "bad resource map"
88
+ raise
85
89
else :
86
- raise
90
+ return refno
91
+ # Finally try decoding an AppleSingle file
92
+ pathname = _decode (pathname )
93
+ refno = Res .FSOpenResourceFile (pathname , u'' , 1 )
87
94
return refno
88
95
89
96
def _decode (pathname ):
You can’t perform that action at this time.
0 commit comments