mypy: Get rid of six.moves.configparser and add appropriate classes.

This commit is contained in:
Joshua Pan 2016-12-30 02:07:46 +00:00 committed by Tim Abbott
parent 6b52b51db6
commit f9104fb7e4

View file

@ -27,8 +27,7 @@ from __future__ import print_function
import os
import sys
import optparse
import six.moves.configparser
from six.moves.configparser import ConfigParser
from six.moves.configparser import ConfigParser, NoSectionError, NoOptionError
import zulip
VERSION = "0.9"
@ -99,7 +98,7 @@ try:
consumer_secret = config.get('twitter', 'consumer_secret')
access_token_key = config.get('twitter', 'access_token_key')
access_token_secret = config.get('twitter', 'access_token_secret')
except (six.moves.configparser.NoSectionError, six.moves.configparser.NoOptionError):
except (NoSectionError, NoOptionError):
parser.error("Please provide a ~/.zulip_twitterrc")
if not consumer_key or not consumer_secret or not access_token_key or not access_token_secret:
@ -124,12 +123,12 @@ if not user.id:
try:
since_id = config.getint('twitter', 'since_id')
except six.moves.configparser.NoOptionError:
except NoOptionError:
since_id = -1
try:
user_id = config.get('twitter', 'user_id')
except six.moves.configparser.NoOptionError:
except NoOptionError:
user_id = options.twitter_id
client = zulip.Client(