scott-griffiths / bitstring

A Python module to help you manage your bits
https://bitstring.readthedocs.io/en/stable/index.html
MIT License
404 stars 68 forks source link

Wrong exception raised when using ints to initialise inappropriately. #247

Closed scott-griffiths closed 1 year ago

scott-griffiths commented 1 year ago
>>> a = bitstring.BitArray(bin=1)
...
    return ''.join(s.split()).lower().replace('_', '')
                   ^^^^^^^
AttributeError: 'int' object has no attribute 'split'

Not a very helpful error, and I would expect it to be a bitstring.CreationError?

scott-griffiths commented 1 year ago

Now raises a ValueError with a better message.