astropy/astropy — pull request #492 by mdboom (2012-11-19 20:27:44+00:00)
Title: give a slightly more helpful error message when an invalid unit constructor is given

I noticed the following
```
>>> class A(object):
>>> pass
>>> u.Unit(A())
AttributeError: 'NoneType' object has no attribute 'Unit'
```

Can this be modified to instead give an error with a message that specifically indicates that you tried to instantiate an invalid `Unit`? And perhaps be a ValueError or TypeError instead of an AttributeError?

@mdboom