Skip to content

Commit 6263595

Browse files
committed
Replace typing.Text with str.
Signed-off-by: Anders Kaseorg <[email protected]>
1 parent 189cf48 commit 6263595

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

zulip/integrations/nagios/nagios-notify-zulip

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python3
22
import argparse
3-
from typing import Any, Dict, Text
3+
from typing import Any, Dict
44

55
import zulip
66

@@ -30,7 +30,7 @@ msg = dict(type="stream", to=opts.stream) # type: Dict[str, Any]
3030
# We send PROBLEM and RECOVERY messages to the same subject.
3131
if opts.service is None:
3232
# Host notification
33-
thing = "host" # type: Text
33+
thing = "host"
3434
msg["subject"] = f"host {opts.host}"
3535
else:
3636
# Service notification
@@ -45,7 +45,7 @@ msg["content"] = f"**{opts.type}**: {thing} is {opts.state}"
4545
# The "long output" can contain newlines represented by "\n" escape sequences.
4646
# The Nagios mail command uses /usr/bin/printf "%b" to expand these.
4747
# We will be more conservative and handle just this one escape sequence.
48-
output = (opts.output + "\n" + opts.long_output.replace(r"\n", "\n")).strip() # type: Text
48+
output = (opts.output + "\n" + opts.long_output.replace(r"\n", "\n")).strip()
4949
if output:
5050
# Put any command output in a code block.
5151
msg["content"] += "\n\n~~~~\n" + output + "\n~~~~\n"

zulip/integrations/svn/post-commit

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import os
1313
import os.path
1414
import sys
15-
from typing import Any, Dict, Optional, Text, Tuple
15+
from typing import Any, Dict
1616

1717
import pysvn
1818

@@ -34,19 +34,19 @@ client = zulip.Client(
3434
) # type: zulip.Client
3535
svn = pysvn.Client() # type: pysvn.Client
3636

37-
path, rev = sys.argv[1:] # type: Tuple[Text, Text]
37+
path, rev = sys.argv[1:]
3838

3939
# since its a local path, prepend "file://"
4040
path = "file://" + path
4141

4242
entry = svn.log(path, revision_end=pysvn.Revision(pysvn.opt_revision_kind.number, rev))[
4343
0
44-
] # type: Dict[Text, Any]
44+
] # type: Dict[str, Any]
4545
message = "**{}** committed revision r{} to `{}`.\n\n> {}".format(
4646
entry["author"], rev, path.split("/")[-1], entry["revprops"]["svn:log"]
47-
) # type: Text
47+
)
4848

49-
destination = config.commit_notice_destination(path, rev) # type: Optional[Dict[Text, Text]]
49+
destination = config.commit_notice_destination(path, rev)
5050

5151
if destination is not None:
5252
message_data = {

zulip/tests/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import pkgutil
2-
from typing import Iterable, Text
2+
from typing import Iterable
33

4-
__path__ = pkgutil.extend_path(__path__, __name__) # type: Iterable[Text]
4+
__path__ = pkgutil.extend_path(__path__, __name__) # type: Iterable[str]

zulip_botserver/tests/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import pkgutil
2-
from typing import Iterable, Text
2+
from typing import Iterable
33

4-
__path__ = pkgutil.extend_path(__path__, __name__) # type: Iterable[Text]
4+
__path__ = pkgutil.extend_path(__path__, __name__) # type: Iterable[str]

0 commit comments

Comments
 (0)