Fix unpickling/copying tf.app.flags.FLAGS (#11437)
pickle.load() and copy.copy() check for the presence of __setstate__(). The problem is that this check is made in the freshly allocated instance which has not been __init__()-ed. Thus it's __dict__ is completely empty and __getattr__() fail with KeyError. The fix is to check if __parsed is in the __dict__ and raise AttributeError if it isn't.
Loading
Please sign in to comment