mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Upgrade toml to 0.10.2
This commit is contained in:
parent
910b304a97
commit
74b1db4f64
7 changed files with 13 additions and 10 deletions
1
news/toml.vendor.rst
Normal file
1
news/toml.vendor.rst
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Upgrade toml to 0.10.2
|
|
@ -6,7 +6,7 @@ Released under the MIT license.
|
||||||
from pip._vendor.toml import encoder
|
from pip._vendor.toml import encoder
|
||||||
from pip._vendor.toml import decoder
|
from pip._vendor.toml import decoder
|
||||||
|
|
||||||
__version__ = "0.10.1"
|
__version__ = "0.10.2"
|
||||||
_spec_ = "0.5.0"
|
_spec_ = "0.5.0"
|
||||||
|
|
||||||
load = decoder.load
|
load = decoder.load
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
# content after the \
|
|
||||||
escapes = ['0', 'b', 'f', 'n', 'r', 't', '"']
|
|
||||||
# What it should be replaced by
|
|
||||||
escapedchars = ['\0', '\b', '\f', '\n', '\r', '\t', '\"']
|
|
||||||
# Used for substitution
|
|
||||||
escape_to_escapedchars = dict(zip(_escapes, _escapedchars))
|
|
|
@ -440,7 +440,8 @@ def loads(s, _dict=dict, decoder=None):
|
||||||
groups[i][0] == "'"):
|
groups[i][0] == "'"):
|
||||||
groupstr = groups[i]
|
groupstr = groups[i]
|
||||||
j = i + 1
|
j = i + 1
|
||||||
while not groupstr[0] == groupstr[-1]:
|
while ((not groupstr[0] == groupstr[-1]) or
|
||||||
|
len(groupstr) == 1):
|
||||||
j += 1
|
j += 1
|
||||||
if j > len(groups) + 2:
|
if j > len(groups) + 2:
|
||||||
raise TomlDecodeError("Invalid group name '" +
|
raise TomlDecodeError("Invalid group name '" +
|
||||||
|
@ -811,8 +812,12 @@ class TomlDecoder(object):
|
||||||
raise ValueError("Empty value is invalid")
|
raise ValueError("Empty value is invalid")
|
||||||
if v == 'true':
|
if v == 'true':
|
||||||
return (True, "bool")
|
return (True, "bool")
|
||||||
|
elif v.lower() == 'true':
|
||||||
|
raise ValueError("Only all lowercase booleans allowed")
|
||||||
elif v == 'false':
|
elif v == 'false':
|
||||||
return (False, "bool")
|
return (False, "bool")
|
||||||
|
elif v.lower() == 'false':
|
||||||
|
raise ValueError("Only all lowercase booleans allowed")
|
||||||
elif v[0] == '"' or v[0] == "'":
|
elif v[0] == '"' or v[0] == "'":
|
||||||
quotechar = v[0]
|
quotechar = v[0]
|
||||||
testv = v[1:].split(quotechar)
|
testv = v[1:].split(quotechar)
|
||||||
|
|
|
@ -61,7 +61,7 @@ def dumps(o, encoder=None):
|
||||||
retval += addtoretval
|
retval += addtoretval
|
||||||
outer_objs = [id(o)]
|
outer_objs = [id(o)]
|
||||||
while sections:
|
while sections:
|
||||||
section_ids = [id(section) for section in sections]
|
section_ids = [id(section) for section in sections.values()]
|
||||||
for outer_obj in outer_objs:
|
for outer_obj in outer_objs:
|
||||||
if outer_obj in section_ids:
|
if outer_obj in section_ids:
|
||||||
raise ValueError("Circular reference detected")
|
raise ValueError("Circular reference detected")
|
||||||
|
|
|
@ -11,6 +11,9 @@ class TomlTz(tzinfo):
|
||||||
self._hours = int(self._raw_offset[1:3])
|
self._hours = int(self._raw_offset[1:3])
|
||||||
self._minutes = int(self._raw_offset[4:6])
|
self._minutes = int(self._raw_offset[4:6])
|
||||||
|
|
||||||
|
def __deepcopy__(self, memo):
|
||||||
|
return self.__class__(self._raw_offset)
|
||||||
|
|
||||||
def tzname(self, dt):
|
def tzname(self, dt):
|
||||||
return "UTC" + self._raw_offset
|
return "UTC" + self._raw_offset
|
||||||
|
|
||||||
|
|
|
@ -20,5 +20,5 @@ resolvelib==0.5.2
|
||||||
retrying==1.3.3
|
retrying==1.3.3
|
||||||
setuptools==44.0.0
|
setuptools==44.0.0
|
||||||
six==1.15.0
|
six==1.15.0
|
||||||
toml==0.10.1
|
toml==0.10.2
|
||||||
webencodings==0.5.1
|
webencodings==0.5.1
|
||||||
|
|
Loading…
Reference in a new issue