astropy/astropy — pull request #2047 by mdboom (2014-02-05 18:34:00+00:00)
Title: Unit unpickling fails for UnrecognizedUnit

As originally noted in the post-merge discussion of #792:
```
In [56]: t = Table([[1]])
In [57]: t['col0'].unit = 'blah' # would succeed for unit = 'm'
In [58]: tpp = pickle.loads(pickle.dumps(t))
ERROR: AttributeError: 'NoneType' object has no attribute '__dict__' [pickle]
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
in ()
----> 1 tpp = pickle.loads(pickle.dumps(t))

/Users/aldcroft/anaconda/envs/astroquery/python.app/Contents/lib/python2.7/pickle.pyc in loads(str)
1380 def loads(str):
1381 file = StringIO(str)
-> 1382 return Unpickler(file).load()
1383
1384 # Doctest

/Users/aldcroft/anaconda/envs/astroquery/python.app/Contents/lib/python2.7/pickle.pyc in load(self)
856 while 1:
857 key = read(1)
--> 858 dispatch[key](self)
859 except _Stop, stopinst:
860 return stopinst.value

/Users/aldcroft/anaconda/envs/astroquery/python.app/Contents/lib/python2.7/pickle.pyc in load_build(self)
1222 if state:
1223 try:
-> 1224 d = inst.__dict__
1225 try:
1226 for k, v in state.iteritems():

AttributeError: 'NoneType' object has no attribute '__dict__'
```