Update berlekamp_massey.py

Just fixed some exception messages.