Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

check-issue-labels: Fix configparser import.

Anders Kaseorg123d527c9e72
diff --git a/tools/check-issue-labels b/tools/check-issue-labels
index 5115df2fe6f..8ff7e785cf3 100755
--- a/tools/check-issue-labels
+++ b/tools/check-issue-labels
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
import argparse
+import configparser
import os
import re
import sys
@@ -7,8 +8,6 @@ from typing import Any, Dict, Optional
import requests
-import ConfigParser
-
# Scans zulip repositary for issues that don't have any `area` labels.
# GitHub API token is required as GitHub limits unauthenticated
# requests to 60/hour. There is a good chance that this limit is
@@ -21,8 +20,8 @@ import ConfigParser
# usage: python check-issue-labels
# Pass --force as an argument to run without a token.
-def get_config() -> ConfigParser:
- config = ConfigParser()
+def get_config() -> configparser.ConfigParser:
+ config = configparser.ConfigParser()
config.read(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'conf.ini'))
return config
@@ -52,7 +51,7 @@ def check_issue_labels() -> None:
config = get_config()
try:
token = config.get('github', 'api_token')
- except KeyError:
+ except configparser.Error:
print("Error fetching GitHub api token. Copy conf.ini-template to conf.ini and populate with "
"your api token. If you want to continue without using a token use --force.")
sys.exit(1)