From 4310bcaf2353f11760efd9f59375e95fcb39cd53 Mon Sep 17 00:00:00 2001 From: frostming Date: Wed, 7 Nov 2018 10:06:14 +0800 Subject: [PATCH] remove the tricky lines --- .../patches/patched/prettytoml-unicode.patch | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/tasks/vendoring/patches/patched/prettytoml-unicode.patch b/tasks/vendoring/patches/patched/prettytoml-unicode.patch index 3bf3ab56..54f4c621 100644 --- a/tasks/vendoring/patches/patched/prettytoml-unicode.patch +++ b/tasks/vendoring/patches/patched/prettytoml-unicode.patch @@ -11,8 +11,8 @@ index 8299195..2decd02 100644 import datetime import six @@ -81,10 +82,30 @@ def create_string_token(text, bare_string_allowed=False, multiline_strings_allow - - + + def _escape_single_line_quoted_string(text): - if six.PY2: - return text.encode('unicode-escape').encode('string-escape').replace('"', '\\"').replace("\\'", "'") @@ -42,8 +42,8 @@ index 8299195..2decd02 100644 + + flush() + return ''.join(res) - - + + def _create_multiline_string_token(text): diff --git a/pipenv/patched/prettytoml/tokens/toml2py.py b/pipenv/patched/prettytoml/tokens/toml2py.py index 2bf9c1c..5680443 100644 @@ -54,15 +54,6 @@ index 2bf9c1c..5680443 100644 import re import string import iso8601 -@@ -19,7 +20,7 @@ def deserialize(token): - - Raises DeserializationError when appropriate. - """ -- -+ - if token.type == TYPE_BOOLEAN: - return _to_boolean(token) - elif token.type == TYPE_INTEGER: @@ -39,42 +40,40 @@ def _unescape_str(text): """ Unescapes a string according the TOML spec. Raises BadEscapeCharacter when appropriate. @@ -136,6 +127,6 @@ index 2bf9c1c..5680443 100644 + tokens.append(escapes[text[i]]) + i += 1 + return ''.join(tokens) - - + + def _to_string(token):