mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-08 16:53:23 +00:00
17 lines
363 B
Python
17 lines
363 B
Python
import yaml
|
|
|
|
# Use the libYAML versions if possible
|
|
try:
|
|
from yaml import CDumper as Dumper
|
|
from yaml import CLoader as Loader
|
|
except ImportError:
|
|
from yaml import Dumper, Loader
|
|
|
|
|
|
def deserialize(cassette_string):
|
|
return yaml.load(cassette_string, Loader=Loader)
|
|
|
|
|
|
def serialize(cassette_dict):
|
|
return yaml.dump(cassette_dict, Dumper=Dumper)
|