diff options
Diffstat (limited to 'tensorflow/python/platform/flags.py')
-rw-r--r-- | tensorflow/python/platform/flags.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tensorflow/python/platform/flags.py b/tensorflow/python/platform/flags.py index f70dbf18d4..60ec4f84c4 100644 --- a/tensorflow/python/platform/flags.py +++ b/tensorflow/python/platform/flags.py @@ -44,7 +44,12 @@ class _FlagValues(object): def __getattr__(self, name): """Retrieves the 'value' attribute of the flag --name.""" - if not self.__dict__['__parsed']: + try: + parsed = self.__dict__['__parsed'] + except KeyError: + # May happen during pickle.load or copy.copy + raise AttributeError(name) + if not parsed: self._parse_flags() if name not in self.__dict__['__flags']: raise AttributeError(name) |