8000 One-Time Code Formatting Improvement via `--preview` Flag of `black` … · guillemap/python-telegram-bot@ab90cd7 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ab90cd7

Browse files
authored
One-Time Code Formatting Improvement via --preview Flag of black (python-telegram-bot#3882)
1 parent 5b0f169 commit ab90cd7

19 files changed

+220
-159
lines changed

docs/auxil/admonition_inserter.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def _create_available_in(self) -> dict[type, str]:
194194
)
195195
except NotImplementedError as e:
196196
raise NotImplementedError(
197-
f"Error generating Sphinx 'Available in' admonition "
197+
"Error generating Sphinx 'Available in' admonition "
198198
f"(admonition_inserter.py). Class {name_of_class_in_attr} present in "
199199
f"attribute {target_attr} of class {name_of_inspected_class_in_docstr}"
200200
f" could not be resolved. {str(e)}"
@@ -237,7 +237,7 @@ def _create_available_in(self) -> dict[type, str]:
237237
)
238238
except NotImplementedError as e:
239239
raise NotImplementedError(
240-
f"Error generating Sphinx 'Available in' admonition "
240+
"Error generating Sphinx 'Available in' admonition "
241241
f"(admonition_inserter.py). Class {name_of_class_in_prop} present in "
242242
f"property {prop_name} of class {name_of_inspected_class_in_docstr}"
243243
f" could not be resolved. {str(e)}"
@@ -269,7 +269,7 @@ def _create_returned_in(self) -> dict[type, str]:
269269
)
270270
except NotImplementedError as e:
271271
raise NotImplementedError(
272-
f"Error generating Sphinx 'Returned in' admonition "
272+
"Error generating Sphinx 'Returned in' admonition "
273273
f"(admonition_inserter.py). {cls}, method {method_name}. "
274274
f"Couldn't resolve type hint in return annotation {ret_annot}. {str(e)}"
275275
)
@@ -342,7 +342,7 @@ def _create_use_in(self) -> dict[type, str]:
342342
)
343343
except NotImplementedError as e:
344344
raise NotImplementedError(
345-
f"Error generating Sphinx 'Use in' admonition "
345+
"Error generating Sphinx 'Use in' admonition "
346346
f"(admonition_inserter.py). {cls}, method {method_name}, parameter "
347347
f"{param}: Couldn't resolve type hint {param.annotation}. {str(e)}"
348348
)

docs/auxil/kwargs_insertion.py

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,41 @@
1818
import inspect
1919

2020
keyword_args = [
21-
":keyword _sphinx_paramlinks_telegram.Bot.{method}.read_timeout: Value to pass to "
22-
":paramref:`telegram.request.BaseRequest.post.read_timeout`. Defaults to {read_timeout}.",
21+
(
22+
":keyword _sphinx_paramlinks_telegram.Bot.{method}.read_timeout: Value to pass to "
23+
":paramref:`telegram.request.BaseRequest.post.read_timeout`. Defaults to {read_timeout}."
24+
),
2325
":kwtype _sphinx_paramlinks_telegram.Bot.{method}.read_timeout: {read_timeout_type}, optional",
24-
":keyword _sphinx_paramlinks_telegram.Bot.{method}.write_timeout: Value to pass to "
25-
":paramref:`telegram.request.BaseRequest.post.write_timeout`. Defaults to {write_timeout}.",
26-
":kwtype _sphinx_paramlinks_telegram.Bot.{method}.write_timeout: :obj:`float` | :obj:`None`, "
27-
"optional",
28-
":keyword _sphinx_paramlinks_telegram.Bot.{method}.connect_timeout: Value to pass to "
29-
":paramref:`telegram.request.BaseRequest.post.connect_timeout`. Defaults to "
30-
":attr:`~telegram.request.BaseRequest.DEFAULT_NONE`.",
31-
":kwtype _sphinx_paramlinks_telegram.Bot.{method}.connect_timeout: :obj:`float` | "
32-
":obj:`None`, optional",
33-
":keyword _sphinx_paramlinks_telegram.Bot.{method}.pool_timeout: Value to pass to "
34-
":paramref:`telegram.request.BaseRequest.post.pool_timeout`. Defaults to "
35-
":attr:`~telegram.request.BaseRequest.DEFAULT_NONE`.",
36-
":kwtype _sphinx_paramlinks_telegram.Bot.{method}.pool_timeout: :obj:`float` | :obj:`None`, "
37-
"optional",
38-
":keyword _sphinx_paramlinks_telegram.Bot.{method}.api_kwargs: Arbitrary keyword arguments "
39-
"to be passed to the Telegram API.",
26+
(
27+
":keyword _sphinx_paramlinks_telegram.Bot.{method}.write_timeout: Value to pass to "
28+
":paramref:`telegram.request.BaseRequest.post.write_timeout`. Defaults to {write_timeout}."
29+
),
30+
(
31+
":kwtype _sphinx_paramlinks_telegram.Bot.{method}.write_timeout: :obj:`float` |"
32+
" :obj:`None`, optional"
33+
),
34+
(
35+
":keyword _sphinx_paramlinks_telegram.Bot.{method}.connect_timeout: Value to pass to "
36+
":paramref:`telegram.request.BaseRequest.post.connect_timeout`. Defaults to "
37+
":attr:`~telegram.request.BaseRequest.DEFAULT_NONE`."
38+
),
39+
(
40+
":kwtype _sphinx_paramlinks_telegram.Bot.{method}.connect_timeout: :obj:`float` | "
41+
":obj:`None`, optional"
42+
),
43+
(
44+
":keyword _sphinx_paramlinks_telegram.Bot.{method}.pool_timeout: Value to pass to "
45+
":paramref:`telegram.request.BaseRequest.post.pool_timeout`. Defaults to "
46+
":attr:`~telegram.request.BaseRequest.DEFAULT_NONE`."
47+
),
48+
(
49+
":kwtype _sphinx_paramlinks_telegram.Bot.{method}.pool_timeout: :obj:`float` |"
50+
" :obj:`None`, optional"
51+
),
52+
(
53+
":keyword _sphinx_paramlinks_telegram.Bot.{method}.api_kwargs: Arbitrary keyword arguments"
54+
" to be passed to the Telegram API."
55+
),
4056
":kwtype _sphinx_paramlinks_telegram.Bot.{method}.api_kwargs: :obj:`dict`, optional",
4157
"",
4258
]

docs/source/conf.py

Lines changed: 60 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@
9696
]
9797
linkcheck_allowed_redirects = {
9898
# Redirects to the default version are okay
99-
r"https://docs\.python-telegram-bot\.org/.*": r"https://docs\.python-telegram-bot\.org/en/[\w\d\.]+/.*",
99+
r"https://docs\.python-telegram-bot\.org/.*": (
100+
r"https://docs\.python-telegram-bot\.org/en/[\w\d\.]+/.*"
101+
),
100102
# pre-commit.ci always redirects to the latest run
101103
re.escape(
102104
"https://results.pre-commit.ci/latest/github/python-telegram-bot/python-telegram-bot/master"
@@ -131,71 +133,79 @@
131133
"admonition-title-font-size": "0.95rem",
132134
"admonition-font-size": "0.92rem",
133135
},
134-
"announcement": "PTB has undergone significant changes in v20. Please read the documentation "
135-
"carefully and also check out the transition guide in the "
136-
'<a href="https://github.com/python-telegram-bot/python-telegram-bot/wiki/'
137-
'Transition-guide-to-Version-20.0">wiki</a>.',
136+
"announcement": (
137+
"PTB has undergone significant changes in v20. Please read the documentation "
138+
"carefully and also check out the transition guide in the "
139+
'<a href="https://github.com/python-telegram-bot/python-telegram-bot/wiki/'
140+
'Transition-guide-to-Version-20.0">wiki</a>.'
141+
),
138142
"footer_icons": [
139143
{
140144
# Telegram channel logo
141145
"name": "Telegram Channel",
142146
"url": "https://t.me/pythontelegrambotchannel/",
143147
# Following svg is from https://react-icons.github.io/react-icons/search?q=telegram
144-
"html": '<svg stroke="currentColor" fill="currentColor" stroke-width="0" '
145-
'viewBox="0 0 16 16" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg">'
146-
'<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8.287 5.906c-.778.324-2.334.994'
147-
"-4.666 2.01-.378.15-.577.298-.595.442-.03.243.275.339.69.47l.175.055c.408.133."
148-
"958.288 1.243.294.26.006.549-.1.868-.32 2.179-1.471 3.304-2.214 3.374-2.23.0"
149-
"5-.012.12-.026.166.016.047.041.042.12.037.141-.03.129-1.227 1.241-1.846 1.81"
150-
"7-.193.18-.33.307-.358.336a8.154 8.154 0 0 1-.188.186c-.38.366-.664.64.015 1.08"
151-
"8.327.216.589.393.85.571.284.194.568.387.936.629.093.06.183.125.27.187.331.23"
152-
"6.63.448.997.414.214-.02.435-.22.547-.82.265-1.417.786-4.486.906-5.751a1.426 "
153-
"1.426 0 0 0-.013-.315.337.337 0 0 0-.114-.217.526.526 0 0 0-.31-.093c-.3.005-.7"
154-
'63.166-2.984 1.09z"></path></svg>',
148+
"html": (
149+
'<svg stroke="currentColor" fill="currentColor" stroke-width="0" '
150+
'viewBox="0 0 16 16" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg">'
151+
'<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8.287 5.906c-.778.324-2.334.994'
152+
"-4.666 2.01-.378.15-.577.298-.595.442-.03.243.275.339.69.47l.175.055c.408.133."
153+
"958.288 1.243.294.26.006.549-.1.868-.32 2.179-1.471 3.304-2.214 3.374-2.23.0"
154+
"5-.012.12-.026.166.016.047.041.042.12.037.141-.03.129-1.227 1.241-1.846 1.81"
155+
"7-.193.18-.33.307-.358.336a8.154 8.154 0 0 1-.188.186c-.38.366-.664.64.015 1.08"
156+
"8.327.216.589.393.85.571.284.194.568.387.936.629.093.06.183.125.27.187.331.23"
157+
"6.63.448.997.414.214-.02.435-.22.547-.82.265-1.417.786-4.486.906-5.751a1.426 "
158+
"1.426 0 0 0-.013-.315.337.337 0 0 0-.114-.217.526.526 0 0 0-.31-.093c-.3.005-.7"
159+
'63.166-2.984 1.09z"></path></svg>'
160+
),
155161
"class": "",
156162
},
157163
{ # Github logo
158164
"name": "GitHub",
159165
"url": "https://github.com/python-telegram-bot/python-telegram-bot/",
160-
"html": '<svg stroke="currentColor" fill="currentColor" stroke-width="0" '
161-
'viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 '
162-
"2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.4"
163-
"9-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23"
164-
".82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 "
165-
"0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.2"
166-
"7 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.5"
167-
"1.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 "
168-
'1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z">'
169-
"</path></svg>",
166+
"html": (
167+
'<svg stroke="currentColor" fill="currentColor" stroke-width="0" '
168+
'viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 '
169+
"2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.4"
170+
"9-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23"
171+
".82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 "
172+
"0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.2"
173+
"7 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.5"
174+
"1.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 "
175+
'1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z">'
176+
"</path></svg>"
177+
),
170178
"class": "",
171179
},
172180
{ # PTB website logo - globe
173181
"name": "python-telegram-bot website",
174182
"url": "https://python-telegram-bot.org/",
175-
"html": '<svg stroke="currentColor" fill="currentColor" stroke-width="0" '
176-
'viewBox="0 0 16 16" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg">'
177-
'<path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8zm7.5-6.923c-.67.204-1.335.82-1.887 '
178-
"1.855-.143.268-.276.56-.395.872.705.157 1.472.257 2.282.287V1.077zM4.249 3.53"
179-
"9c.142-.384.304-.744.481-1.078a6.7 6.7 0 0 1 .597-.933A7.01 7.01 0 0 0 3.051 "
180-
"3.05c.362.184.763.349 1.198.49zM3.509 7.5c.036-1.07.188-2.087.436-3.008a9.124 "
181-
"9.124 0 0 1-1.565-.667A6.964 6.964 0 0 0 1.018 7.5h2.49zm1.4-2.741a12.344 "
182-
"12.344 0 0 0-.4 2.741H7.5V5.091c-.91-.03-1.783-.145-2.591-.332zM8.5 5.09V7.5h"
183-
"2.99a12.342 12.342 0 0 0-.399-2.741c-.808.187-1.681.301-2.591.332zM4.51 8.5c.03"
184-
"5.987.176 1.914.399 2.741A13.612 13.612 0 0 1 7.5 10.91V8.5H4.51zm3.99 0v2.409"
185-
"c.91.03 1.783.145 2.591.332.223-.827.364-1.754.4-2.741H8.5zm-3.282 3.696c.12.31"
186-
"2.252.604.395.872.552 1.035 1.218 1.65 1.887 1.855V11.91c-.81.03-1.577.13-2.28"
187-
"2.287zm.11 2.276a6.696 6.696 0 0 1-.598-.933 8.853 8.853 0 0 1-.481-1.079 8.38 "
188-
"8.38 0 0 0-1.198.49 7.01 7.01 0 0 0 2.276 1.522zm-1.383-2.964A13.36 13.36 0 0 1"
189-
" 3.508 8.5h-2.49a6.963 6.963 0 0 0 1.362 3.675c.47-.258.995-.482 1.565-.667zm"
190-
"6.728 2.964a7.009 7.009 0 0 0 2.275-1.521 8.376 8.376 0 0 0-1.197-.49 8.853 "
191-
"8.853 0 0 1-.481 1.078 6.688 6.688 0 0 1-.597.933zM8.5 11.909v3.014c.67-.204 "
192-
"1.335-.82 1.887-1.855.143-.268.276-.56.395-.872A12.63 12.63 0 0 0 8.5 11.91zm"
193-
"3.555-.401c.57.185 1.095.409 1.565.667A6.963 6.963 0 0 0 14.982 8.5h-2.49a1"
194-
"3.36 13.36 0 0 1-.437 3.008zM14.982 7.5a6.963 6.963 0 0 0-1.362-3.675c-.47.25"
195-
"8-.995.482-1.565.667.248.92.4 1.938.437 3.008h2.49zM11.27 2.461c.177.334.339.6"
196-
"94.482 1.078a8.368 8.368 0 0 0 1.196-.49 7.01 7.01 0 0 0-2.275-1.52c.218.283.4"
197-
"18.597.597.932zm-.488 1.343a7.765 7.765 0 0 0-.395-.872C9.835 1.897 9.17 1.282 "
198-
'8.5 1.077V4.09c.81-.03 1.577-.13 2.282-.287z"></path></svg>',
183+
"html": (
184+
'<svg stroke="currentColor" fill="currentColor" stroke-width="0" '
185+
'viewBox="0 0 16 16" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg">'
186+
'<path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8zm7.5-6.923c-.67.204-1.335.82-1.887 '
187+
"1.855-.143.268-.276.56-.395.872.705.157 1.472.257 2.282.287V1.077zM4.249 3.53"
188+
"9c.142-.384.304-.744.481-1.078a6.7 6.7 0 0 1 .597-.933A7.01 7.01 0 0 0 3.051 "
189+
"3.05c.362.184.763.349 1.198.49zM3.509 7.5c.036-1.07.188-2.087.436-3.008a9.124 "
190+
"9.124 0 0 1-1.565-.667A6.964 6.964 0 0 0 1.018 7.5h2.49zm1.4-2.741a12.344 "
191+
"12.344 0 0 0-.4 2.741H7.5V5.091c-.91-.03-1.783-.145-2.591-.332zM8.5 5.09V7.5h"
192+
"2.99a12.342 12.342 0 0 0-.399-2.741c-.808.187-1.681.301-2.591.332zM4.51 8.5c.03"
193+
"5.987.176 1.914.399 2.741A13.612 13.612 0 0 1 7.5 10.91V8.5H4.51zm3.99 0v2.409"
194+
"c.91.03 1.783.145 2.591.332.223-.827.364-1.754.4-2.741H8.5zm-3.282 3.696c.12.31"
195+
"2.252.604.395.872.552 1.035 1.218 1.65 1.887 1.855V11.91c-.81.03-1.577.13-2.28"
196+
"2.287zm.11 2.276a6.696 6.696 0 0 1-.598-.933 8.853 8.853 0 0 1-.481-1.079 8.38 "
197+
"8.38 0 0 0-1.198.49 7.01 7.01 0 0 0 2.276 1.522zm-1.383-2.964A13.36 13.36 0 0 1"
198+
" 3.508 8.5h-2.49a6.963 6.963 0 0 0 1.362 3.675c.47-.258.995-.482 1.565-.667zm"
199+
"6.728 2.964a7.009 7.009 0 0 0 2.275-1.521 8.376 8.376 0 0 0-1.197-.49 8.853 "
200+
"8.853 0 0 1-.481 1.078 6.688 6.688 0 0 1-.597.933zM8.5 11.909v3.014c.67-.204 "
201+
"1.335-.82 1.887-1.855.143-.268.276-.56.395-.872A12.63 12.63 0 0 0 8.5 11.91zm"
202+
"3.555-.401c.57.185 1.095.409 1.565.667A6.963 6.963 0 0 0 14.982 8.5h-2.49a1"
203+
"3.36 13.36 0 0 1-.437 3.008zM14.982 7.5a6.963 6.963 0 0 0-1.362-3.675c-.47.25"
204+
"8-.995.482-1.565.667.248.92.4 1.938.437 3.008h2.49zM11.27 2.461c.177.334.339.6"
205+
"94.482 1.078a8.368 8.368 0 0 0 1.196-.49 7.01 7.01 0 0 0-2.275-1.52c.218.283.4"
206+
"18.597.597.932zm-.488 1.343a7.765 7.765 0 0 0-.395-.872C9.835 1.897 9.17 1.282 "
207+
'8.5 1.077V4.09c.81-.03 1.577-.13 2.282-.287z"></path></svg>'
208+
),
199209
"class": "",
200210
},
201211
],

examples/contexttypesbot.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ async def count_click(update: Update, context: CustomContext) -> None:
115115
async def print_users(update: Update, context: CustomContext) -> None:
116116
"""Show which users have been using this bot."""
117117
await update.message.reply_text(
118-
"The following user IDs have used this bot: "
119-
f'{", ".join(map(str, context.bot_user_ids))}'
118+
f"The following user IDs have used this bot: {', '.join(map(str, context.bot_user_ids))}"
120119
)
121120

122121

examples/deeplinking.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ async def deep_linked_level_1(update: Update, context: ContextTypes.DEFAULT_TYPE
5757
bot = context.bot
5858
url = helpers.create_deep_linked_url(bot.username, SO_COOL)
5959
text = (
60-
"Awesome, you just accessed hidden functionality! "
61-
"Now let's get back to the private chat."
60+
"Awesome, you just accessed hidden functionality! Now let's get back to the private chat."
6261
)
6362
keyboard = InlineKeyboardMarkup.from_button(
6463
InlineKeyboardButton(text="Continue here!", url=url)

examples/errorhandlerbot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async def error_handler(update: object, context: ContextTypes.DEFAULT_TYPE) -> N
4040
# You might need to add some logic to deal with messages longer than the 4096 character limit.
4141
update_str = update.to_dict() if isinstance(update, Update) else str(update)
4242
message = (
43-
f"An exception was raised while handling an update\n" 10000
43+
"An exception was raised while handling an update\n"
4444
f"<pre>update = {html.escape(json.dumps(update_str, indent=2, ensure_ascii=False))}"
4545
"</pre>\n\n"
4646
f"<pre>context.chat_data = {html.escape(str(context.chat_data))}</pre>\n\n"

examples/persistentconversationbot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ async def start(update: Update, context: ContextTypes.DEFAULT_TYPE) -> int:
5959
if context.user_data:
6060
reply_text += (
6161
f" You already told me your {', '.join(context.user_data.keys())}. Why don't you "
62-
f"tell me something more about yourself? Or change anything I already know."
62+
"tell me something more about yourself? Or change anything I already know."
6363
)
6464
else:
6565
reply_text += (

examples/webappbot.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ async def web_app_data(update: Update, context: ContextTypes.DEFAULT_TYPE) -> No
4545
# (see webappbot.html)
4646
data = json.loads(update.effective_message.web_app_data.data)
4747
await update.message.reply_html(
48-
text=f"You selected the color with the HEX value <code>{data['hex']}</code>. The "
49-
f"corresponding RGB value is <code>{tuple(data['rgb'].values())}</code>.",
48+
text=(
49+
f"You selected the color with the HEX value <code>{data['hex']}</code>. The "
50+
f"corresponding RGB value is <code>{tuple(data['rgb'].values())}</code>."
51+
),
5052
reply_markup=ReplyKeyboardRemove(),
5153
)
5254

telegram/_bot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,8 @@ def __init__(
291291
if warning_string:
292292
self._warn(
293293
f"You set the HTTP version for the {warning_string} HTTPXRequest instance to "
294-
f"HTTP/2. The self hosted bot api instances only support HTTP/1.1. You should "
295-
f"either run a HTTP proxy in front of it which supports HTTP/2 or use HTTP/1.1.",
294+
"HTTP/2. The self hosted bot api instances only support HTTP/1.1. You should "
295+
"either run a HTTP proxy in front of it which supports HTTP/2 or use HTTP/1.1.",
296296
PTBUserWarning,
297297
stacklevel=2,
298298
)

0 commit comments

Comments
 (0)
0