mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Update web-platform-tests to revision b'468d01bbd84da2babf265c6af46947be68713440'
This commit is contained in:
parent
35e95f55a1
commit
58e8ee674b
9438 changed files with 266112 additions and 106976 deletions
|
@ -1,4 +1,3 @@
|
|||
from six import PY3
|
||||
from wptserve.utils import isomorphic_encode
|
||||
|
||||
# Outputs the request body, with controls and non-ASCII bytes escaped
|
||||
|
@ -6,10 +5,8 @@ from wptserve.utils import isomorphic_encode
|
|||
# As a convenience, CRLF newlines are left as is.
|
||||
|
||||
def escape_byte(byte):
|
||||
# We want a single-char binary string, but in Python 3 we may get an int
|
||||
# from iterating over bytes.
|
||||
if PY3:
|
||||
byte = bytes([byte])
|
||||
# Convert int byte into a single-char binary string.
|
||||
byte = bytes([byte])
|
||||
if b"\0" <= byte <= b"\x1F" or byte >= b"\x7F":
|
||||
return b"\\x%02x" % ord(byte)
|
||||
if byte == b"\\":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue