Skip to content

Commit d43c7ee

Browse files
committed
t push -f
[Enhance] Move `import yapf` to function
1 parent 390ba2f commit d43c7ee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mmengine/config/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@
1717
from pathlib import Path
1818
from typing import Any, Optional, Sequence, Tuple, Union
1919

20-
import yapf
2120
from addict import Dict
2221
from rich.console import Console
2322
from rich.text import Text
24-
from yapf.yapflib.yapf_api import FormatCode
2523

2624
from mmengine.fileio import dump, load
2725
from mmengine.logging import print_log
@@ -1375,6 +1373,8 @@ def env_variables(self) -> dict:
13751373
@property
13761374
def pretty_text(self) -> str:
13771375
"""Get formatted python config text."""
1376+
import yapf
1377+
from yapf.yapflib.yapf_api import FormatCode
13781378

13791379
indent = 4
13801380

0 commit comments

Comments
 (0)