Improve toml docs

This commit is contained in:
Bryce Larson 2020-08-10 22:18:13 +00:00 committed by Daniel Wozniak
parent ed79b663c0
commit 37db1d0f4e

View file

@ -1,22 +1,16 @@
# -*- coding: utf-8 -*-
"""
salt.serializers.toml
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Implements TOML serializer.
It's just a wrapper around pytoml module.
It's just a wrapper around the python toml module.
"""
from __future__ import absolute_import
# Import 3rd-party libs
from salt.ext import six
# Import Salt libs
from salt.serializers import DeserializationError, SerializationError
# Import pytoml
# Import toml
try:
import toml
@ -33,11 +27,11 @@ def deserialize(stream_or_string, **options):
Deserialize from TOML into Python data structure.
:param stream_or_string: toml stream or string to deserialize.
:param options: options given to lower pytoml module.
:param options: options given to the python toml module.
"""
try:
if not isinstance(stream_or_string, (bytes, six.string_types)):
if not isinstance(stream_or_string, (bytes, str)):
return toml.load(stream_or_string, **options)
if isinstance(stream_or_string, bytes):
@ -53,7 +47,7 @@ def serialize(obj, **options):
Serialize Python data to TOML.
:param obj: the data structure to serialize.
:param options: options given to lower pytoml module.
:param options: options given to the python toml module.
"""
try: