Skip to content

Commit

Permalink
Vendor pyyaml for 2to3 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
danbradham committed May 29, 2020
1 parent b95fb83 commit fec7664
Show file tree
Hide file tree
Showing 39 changed files with 12,026 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fsfs/policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def set_id_generator(self, func):
# Yaml Encoder / Decoder
# Used as Default when pyyaml is available
try:
import yaml
from fsfs.vendor import yaml
YamlDecoder = yaml.safe_load
YamlEncoder = partial(
yaml.safe_dump,
Expand Down
Empty file added fsfs/vendor/__init__.py
Empty file.
20 changes: 20 additions & 0 deletions fsfs/vendor/yaml/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2017-2020 Ingy döt Net
Copyright (c) 2006-2016 Kirill Simonov

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
10 changes: 10 additions & 0 deletions fsfs/vendor/yaml/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import sys

try:
import yaml2 as yaml_
except ImportError:
from . import yaml3 as yaml_


# Replace this stub with actual yaml module
sys.modules[__name__] = yaml_
Loading

0 comments on commit fec7664

Please sign in to comment.