mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix bugs in frwrapper returned by lopen on windows
This commit is contained in:
parent
e46fed78cc
commit
ed3909b1a7
@ -120,7 +120,8 @@ if not _run_once:
|
|||||||
object.__setattr__(self, 'name', name)
|
object.__setattr__(self, 'name', name)
|
||||||
|
|
||||||
def __getattribute__(self, attr):
|
def __getattribute__(self, attr):
|
||||||
if attr == 'name':
|
if attr in ('name', '__enter__', '__str__', '__unicode__',
|
||||||
|
'__repr__'):
|
||||||
return object.__getattribute__(self, attr)
|
return object.__getattribute__(self, attr)
|
||||||
fobject = object.__getattribute__(self, 'fobject')
|
fobject = object.__getattribute__(self, 'fobject')
|
||||||
return getattr(fobject, attr)
|
return getattr(fobject, attr)
|
||||||
@ -141,6 +142,10 @@ if not _run_once:
|
|||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return repr(self).decode('utf-8')
|
return repr(self).decode('utf-8')
|
||||||
|
|
||||||
|
def __enter__(self):
|
||||||
|
fobject = object.__getattribute__(self, 'fobject')
|
||||||
|
fobject.__enter__()
|
||||||
|
return self
|
||||||
|
|
||||||
m = mode[0]
|
m = mode[0]
|
||||||
random = len(mode) > 1 and mode[1] == '+'
|
random = len(mode) > 1 and mode[1] == '+'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user