@@ -57,7 +57,7 @@ def _decode_fmt_opts(opts):
5757 if opts is None :
5858 return {}
5959
60- import json
60+ import json # noqa: PLC0415
6161
6262 return json .loads (opts )
6363
@@ -345,7 +345,7 @@ def __init__(self, **kwargs):
345345 """
346346 super ().__init__ ()
347347
348- import json
348+ import json # noqa: PLC0415
349349
350350 self .encoder = json .JSONEncoder (** self .get_opts (kwargs ))
351351
@@ -383,7 +383,7 @@ def __init__(self, **kwargs):
383383 """
384384 super ().__init__ ()
385385
386- import json
386+ import json # noqa: PLC0415
387387
388388 self .decoder = json .JSONDecoder (** self .get_opts (kwargs ))
389389
@@ -404,8 +404,8 @@ def __init__(self, **kwargs):
404404 """
405405 super ().__init__ ()
406406
407- import configparser
408- import io
407+ import configparser # noqa: PLC0415
408+ import io # noqa: PLC0415
409409
410410 self .encoder = configparser .ConfigParser (** self .get_opts (kwargs ))
411411 self .stringio = io .StringIO ()
@@ -430,7 +430,7 @@ def __init__(self, **kwargs):
430430 """
431431 super ().__init__ ()
432432
433- import configparser
433+ import configparser # noqa: PLC0415
434434
435435 self .decoder = configparser .ConfigParser (** kwargs )
436436
@@ -457,7 +457,7 @@ def __init__(self, **kwargs):
457457 """Initialize dumper."""
458458 super ().__init__ ()
459459
460- import pprint
460+ import pprint # noqa: PLC0415
461461
462462 self .codec = pprint .PrettyPrinter (** self .get_opts (kwargs ))
463463
@@ -495,7 +495,7 @@ def __init__(self):
495495 """Initialize dumper."""
496496 super ().__init__ ()
497497
498- import tomli_w
498+ import tomli_w # noqa: PLC0415
499499
500500 self .codec = tomli_w
501501
@@ -512,9 +512,9 @@ def __init__(self):
512512 super ().__init__ ()
513513
514514 if sys .version_info >= (3 , 11 ):
515- import tomllib # pragma nocover
515+ import tomllib # pragma nocover # noqa: PLC0415
516516 else :
517- import tomli as tomllib # pragma nocover
517+ import tomli as tomllib # pragma nocover # noqa: PLC0415
518518
519519 self .codec = tomllib
520520
@@ -535,12 +535,12 @@ def __init__(self, **kwargs):
535535 """
536536 super ().__init__ ()
537537
538- import yaml
538+ import yaml # noqa: PLC0415
539539
540540 try :
541- from yaml import CSafeDumper as ImportedYamlDumper
541+ from yaml import CSafeDumper as ImportedYamlDumper # noqa: PLC0415
542542 except ImportError :
543- from yaml import SafeDumper as ImportedYamlDumper
543+ from yaml import SafeDumper as ImportedYamlDumper # noqa: PLC0415
544544
545545 class _YamlDumper (ImportedYamlDumper ):
546546 def represent_scalar (self , tag , value , style = None ):
@@ -588,16 +588,18 @@ def __init__(self, **kwargs):
588588 """
589589 super ().__init__ ()
590590
591- import yaml
591+ import yaml # noqa: PLC0415
592592
593593 try :
594- from yaml import CSafeLoader as YamlLoader
594+ from yaml import CSafeLoader as YamlLoader # noqa: PLC0415
595595 except ImportError :
596- from yaml import SafeLoader as YamlLoader
596+ from yaml import SafeLoader as YamlLoader # noqa: PLC0415
597597
598- from yaml .nodes import MappingNode as YamlMappingNode
599- from yaml .nodes import ScalarNode as YamlScalarNode
600- from yaml .nodes import SequenceNode as YamlSequenceNode
598+ from yaml .nodes import ( # noqa: PLC0415
599+ MappingNode as YamlMappingNode ,
600+ ScalarNode as YamlScalarNode ,
601+ SequenceNode as YamlSequenceNode ,
602+ )
601603
602604 self .opts = self .get_opts (kwargs )
603605 self .yaml = yaml
0 commit comments