Merge commit '201faa3'

This commit is contained in:
Jonathan Hodgson 2019-12-02 17:13:51 +00:00
commit 213ec0e3eb
2 changed files with 10 additions and 9 deletions

View file

@ -11,9 +11,9 @@ import vim
import threading import threading
from collections import namedtuple from collections import namedtuple
from urlparse import urlparse, ParseResult, parse_qs from urllib.parse import urlparse, ParseResult, parse_qs
from urllib import urlencode from urllib.parse import urlencode
import Cookie as hcookies import http.cookies as hcookies
## STRIPPED DOWN COPY OF HTTP OBJECTS / COMMS ## STRIPPED DOWN COPY OF HTTP OBJECTS / COMMS
@ -1449,6 +1449,7 @@ def parse_rsp_sline(sline):
return ResponseStatusLine(int(pmajor), int(pminor), int(status_code), reason.decode()) return ResponseStatusLine(int(pmajor), int(pminor), int(status_code), reason.decode())
def _parse_message(bs, sline_parser): def _parse_message(bs, sline_parser):
bs = bs.encode()
header_env, body = re.split(b"\r?\n\r?\n", bs, 1) header_env, body = re.split(b"\r?\n\r?\n", bs, 1)
status_line, header_bytes = re.split(b"\r?\n", header_env, 1) status_line, header_bytes = re.split(b"\r?\n", header_env, 1)
h = Headers() h = Headers()
@ -1502,7 +1503,7 @@ def run_command(command):
def set_buffer_content(buf, text): def set_buffer_content(buf, text):
buf[:] = None buf[:] = None
first = True first = True
for l in text.split('\n'): for l in text.split(b'\n'):
if first: if first:
buf[0] = l buf[0] = l
first = False first = False

View file

@ -1,7 +1,7 @@
if !has('python') if !has('python3')
echo "Vim must support python in order to use the repeater" echo "Vim must support python in order to use the repeater"
finish finish
endif endif
" Settings to make life easier " Settings to make life easier
set hidden set hidden
@ -9,7 +9,7 @@ set hidden
let s:pyscript = resolve(expand('<sfile>:p:h') . '/repeater.py') let s:pyscript = resolve(expand('<sfile>:p:h') . '/repeater.py')
function! RepeaterAction(...) function! RepeaterAction(...)
execute 'pyfile ' . s:pyscript execute 'py3file ' . s:pyscript
endfunc endfunc
command! -nargs=* RepeaterSetup call RepeaterAction('setup', <f-args>) command! -nargs=* RepeaterSetup call RepeaterAction('setup', <f-args>)