Merge branch 'pythonoptimize-fix' of https://github.com/lejenome/qutebrowser into lejenome-pythonoptimize-fix
This commit is contained in:
commit
dfd58d456a
@ -300,6 +300,11 @@ def init_log(args):
|
|||||||
log.init_log(args)
|
log.init_log(args)
|
||||||
log.init.debug("Log initialized.")
|
log.init.debug("Log initialized.")
|
||||||
|
|
||||||
|
def check_optimize_flag():
|
||||||
|
from qutebrowser.utils import log
|
||||||
|
if sys.flags.optimize >= 2:
|
||||||
|
log.init.warning("Running on optimize level higher than 1, "
|
||||||
|
"unexpected behaviors may occur.")
|
||||||
|
|
||||||
def earlyinit(args):
|
def earlyinit(args):
|
||||||
"""Do all needed early initialization.
|
"""Do all needed early initialization.
|
||||||
@ -327,3 +332,4 @@ def earlyinit(args):
|
|||||||
remove_inputhook()
|
remove_inputhook()
|
||||||
check_libraries(args)
|
check_libraries(args)
|
||||||
check_ssl_support()
|
check_ssl_support()
|
||||||
|
check_optimize_flag()
|
||||||
|
@ -26,7 +26,7 @@ import os.path
|
|||||||
import collections
|
import collections
|
||||||
|
|
||||||
import qutebrowser
|
import qutebrowser
|
||||||
from qutebrowser.utils import usertypes
|
from qutebrowser.utils import usertypes, log, utils
|
||||||
|
|
||||||
|
|
||||||
def is_git_repo():
|
def is_git_repo():
|
||||||
@ -98,6 +98,15 @@ class DocstringParser:
|
|||||||
self.State.arg_inside: self._parse_arg_inside,
|
self.State.arg_inside: self._parse_arg_inside,
|
||||||
self.State.misc: self._skip,
|
self.State.misc: self._skip,
|
||||||
}
|
}
|
||||||
|
if doc is None:
|
||||||
|
if sys.flags.optimize < 2:
|
||||||
|
log.commands.warning(
|
||||||
|
"Function {}() from {} has no docstring".format(
|
||||||
|
utils.qualname(func),
|
||||||
|
inspect.getsourcefile(func)))
|
||||||
|
self.long_desc = ""
|
||||||
|
self.short_desc = ""
|
||||||
|
return
|
||||||
for line in doc.splitlines():
|
for line in doc.splitlines():
|
||||||
handler = handlers[self._state]
|
handler = handlers[self._state]
|
||||||
stop = handler(line)
|
stop = handler(line)
|
||||||
|
Loading…
Reference in New Issue
Block a user