mirror of
https://github.com/httpie/cli.git
synced 2025-01-12 08:38:28 +01:00
Python 3.3 fixes.
This commit is contained in:
parent
0ae9d7af58
commit
79c412064a
@ -8,7 +8,6 @@ import inspect
|
||||
import argparse
|
||||
import functools
|
||||
|
||||
from . import __version__
|
||||
from .input import RegexValidator
|
||||
from .sessions import (Session, Host,
|
||||
command_session_list,
|
||||
@ -18,8 +17,7 @@ from .sessions import (Session, Host,
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
description='The HTTPie management command.',
|
||||
version=__version__
|
||||
description='The HTTPie management command.'
|
||||
)
|
||||
subparsers = parser.add_subparsers()
|
||||
|
||||
|
@ -168,4 +168,8 @@ class HTTPRequest(HTTPMessage):
|
||||
|
||||
@property
|
||||
def body(self):
|
||||
return self._orig.body or b''
|
||||
body = self._orig.body
|
||||
if isinstance(body, str):
|
||||
# Happens with JSON/form request data parsed from the command line.
|
||||
body = body.encode('utf8')
|
||||
return body or b''
|
||||
|
Loading…
Reference in New Issue
Block a user