Skip to content

Commit

Permalink
Handle None in first.
Browse files Browse the repository at this point in the history
  • Loading branch information
lgastako committed Mar 28, 2013
1 parent 6df0338 commit 2acbe23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mon.py
Expand Up @@ -21,7 +21,7 @@
def first(xs):
try:
return xs[0]
except IndexError:
except (IndexError, TypeError):
if xs is None or len(xs) ==0:
return None
raise
Expand Down

0 comments on commit 2acbe23

Please sign in to comment.