mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Use builtin monotonic in py3
This commit is contained in:
parent
8785619938
commit
82377cb1c4
@ -168,7 +168,6 @@ class Plugins(collections.Mapping):
|
|||||||
'chm_extra',
|
'chm_extra',
|
||||||
'icu',
|
'icu',
|
||||||
'speedup',
|
'speedup',
|
||||||
'monotonic',
|
|
||||||
'unicode_names',
|
'unicode_names',
|
||||||
'zlib2',
|
'zlib2',
|
||||||
'html',
|
'html',
|
||||||
@ -183,6 +182,10 @@ class Plugins(collections.Mapping):
|
|||||||
'certgen',
|
'certgen',
|
||||||
'lzma_binding',
|
'lzma_binding',
|
||||||
]
|
]
|
||||||
|
if not ispy3:
|
||||||
|
plugins.extend([
|
||||||
|
'monotonic',
|
||||||
|
])
|
||||||
if iswindows:
|
if iswindows:
|
||||||
plugins.extend(['winutil', 'wpd', 'winfonts'])
|
plugins.extend(['winutil', 'wpd', 'winfonts'])
|
||||||
if isosx:
|
if isosx:
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
# vim:fileencoding=utf-8
|
# vim:fileencoding=utf-8
|
||||||
|
|
||||||
from calibre.constants import plugins
|
try:
|
||||||
|
from time import monotonic
|
||||||
|
except ImportError:
|
||||||
|
from calibre.constants import plugins
|
||||||
|
|
||||||
monotonicp, err = plugins['monotonic']
|
monotonicp, err = plugins['monotonic']
|
||||||
if err:
|
if err:
|
||||||
raise RuntimeError('Failed to load the monotonic module with error: ' + err)
|
raise RuntimeError('Failed to load the monotonic module with error: ' + err)
|
||||||
monotonic = monotonicp.monotonic
|
monotonic = monotonicp.monotonic
|
||||||
del monotonicp, err
|
del monotonicp, err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user