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',
|
||||
'icu',
|
||||
'speedup',
|
||||
'monotonic',
|
||||
'unicode_names',
|
||||
'zlib2',
|
||||
'html',
|
||||
@ -183,6 +182,10 @@ class Plugins(collections.Mapping):
|
||||
'certgen',
|
||||
'lzma_binding',
|
||||
]
|
||||
if not ispy3:
|
||||
plugins.extend([
|
||||
'monotonic',
|
||||
])
|
||||
if iswindows:
|
||||
plugins.extend(['winutil', 'wpd', 'winfonts'])
|
||||
if isosx:
|
||||
|
@ -1,9 +1,12 @@
|
||||
# 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']
|
||||
if err:
|
||||
raise RuntimeError('Failed to load the monotonic module with error: ' + err)
|
||||
monotonic = monotonicp.monotonic
|
||||
del monotonicp, err
|
||||
monotonicp, err = plugins['monotonic']
|
||||
if err:
|
||||
raise RuntimeError('Failed to load the monotonic module with error: ' + err)
|
||||
monotonic = monotonicp.monotonic
|
||||
del monotonicp, err
|
||||
|
Loading…
x
Reference in New Issue
Block a user