From 0a8a69875c49a02c6e5e2016c370900a6a3aedfd Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Thu, 23 Mar 2017 15:59:51 +0100 Subject: [PATCH] Fix tweet.py --- tweet.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tweet.py b/tweet.py index 7798437..36735c3 100755 --- a/tweet.py +++ b/tweet.py @@ -18,13 +18,14 @@ if __name__ == "__main__": except KeyboardInterrupt: exit(0) - if isinstance(args.reply, int): - reply = args.reply - else: - try: - if "twitter.com" in args.reply and "status" in args.reply: - reply = int(args.reply.split('/')[-1]) - except: - raise ValueError("Invalid tweet ID passed for -r.") + if args.reply: + if isinstance(args.reply, int): + reply = args.reply + else: + try: + if "twitter.com" in args.reply and "status" in args.reply: + reply = int(args.reply.split('/')[-1]) + except: + raise ValueError("Invalid tweet ID passed for -r.") two.tweet(text, reply)