mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
fix
This commit is contained in:
parent
335ea3ae51
commit
9a6eb2f00f
@ -68,6 +68,7 @@ class ResponseBase:
|
||||
self.cookies = {}
|
||||
self.status_code = 0
|
||||
self.__content = b""
|
||||
self.__content_s = []
|
||||
self.content_prepared = threading.Event()
|
||||
self.interonce = True
|
||||
|
||||
@ -77,10 +78,15 @@ class ResponseBase:
|
||||
for _ in self.iter_content():
|
||||
pass
|
||||
self.content_prepared.wait()
|
||||
return self.__content
|
||||
if self.stream:
|
||||
return b"".join(self.__content_s)
|
||||
else:
|
||||
return self.__content
|
||||
|
||||
@content.setter
|
||||
def content(self, c):
|
||||
if self.stream:
|
||||
raise RequestException()
|
||||
self.__content = c
|
||||
self.content_prepared.set()
|
||||
|
||||
@ -110,7 +116,7 @@ class ResponseBase:
|
||||
self.interonce = False
|
||||
|
||||
for chunk in self.iter_content_impl(chunk_size):
|
||||
self.__content += chunk
|
||||
self.__content_s.append(chunk)
|
||||
if decode_unicode:
|
||||
yield chunk.decode("utf8")
|
||||
else:
|
||||
|
@ -29,7 +29,7 @@ include(generate_product_version)
|
||||
|
||||
set(VERSION_MAJOR 5)
|
||||
set(VERSION_MINOR 31)
|
||||
set(VERSION_PATCH 3)
|
||||
set(VERSION_PATCH 4)
|
||||
|
||||
add_library(pch pch.cpp)
|
||||
target_precompile_headers(pch PUBLIC pch.h)
|
||||
|
Loading…
x
Reference in New Issue
Block a user