From f9104fb7e416651c0d762cfe6e2bca26f69e2a04 Mon Sep 17 00:00:00 2001 From: Joshua Pan Date: Fri, 30 Dec 2016 02:07:46 +0000 Subject: [PATCH] mypy: Get rid of six.moves.configparser and add appropriate classes. --- integrations/twitter/twitter-bot | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/integrations/twitter/twitter-bot b/integrations/twitter/twitter-bot index 129471d..eb07830 100755 --- a/integrations/twitter/twitter-bot +++ b/integrations/twitter/twitter-bot @@ -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(