Skip to content

Commit

Permalink
Fixing two minor bugs
Browse files Browse the repository at this point in the history
* Check if status actually contains something (it won't when the request failed)
* UnboundLocalError, oh please how could I forgot
  • Loading branch information
buckket committed Sep 26, 2017
1 parent f86fd00 commit 119a6b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion twtxt/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ def timeline(ctx, pager, limit, twtfile, sorting, timeout, porcelain, source, ca
else:
sources = ctx.obj["conf"].following

tweets = []

if cache:
try:
with Cache.discover(update_interval=ctx.obj["conf"].timeline_update_interval) as cache:
Expand Down Expand Up @@ -238,7 +240,7 @@ def follow(ctx, nick, url, force):
click.style(source.nick, bold=True)), default=False, abort=True)

_, status = get_remote_status([source])[0]
if status != 200:
if not status or status.status_code != 200:
click.confirm("➤ The feed of {0} at {1} is not available. Follow anyway?".format(
click.style(source.nick, bold=True),
click.style(source.url, bold=True)), default=False, abort=True)
Expand Down

0 comments on commit 119a6b9

Please sign in to comment.