Skip to content

Commit

Permalink
[Fix] Delete yapf verify (#2944)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouzaida authored Sep 26, 2023
1 parent 43c2130 commit bc01e96
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mmcv/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
from importlib import import_module
from pathlib import Path

import yapf
from addict import Dict
from yapf.yapflib.yapf_api import FormatCode

from .misc import import_modules_from_strings
from .path import check_file_exist
from .version_utils import digit_version

if platform.system() == 'Windows':
import regex as re # type: ignore
Expand Down Expand Up @@ -505,7 +507,10 @@ def _format_dict(input_dict, outest_level=False):
based_on_style='pep8',
blank_line_before_nested_class_or_def=True,
split_before_expression_after_opening_paren=True)
text, _ = FormatCode(text, style_config=yapf_style, verify=True)
if digit_version(yapf.__version__) >= digit_version('0.40.2'):
text, _ = FormatCode(text, style_config=yapf_style)
else:
text, _ = FormatCode(text, style_config=yapf_style, verify=True)

return text

Expand Down

0 comments on commit bc01e96

Please sign in to comment.