Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Addressing review comments
  • Loading branch information
bsipocz committed Aug 11, 2017
1 parent 1fab752 commit dfd7e7a
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions astropy/table/column.py
Expand Up @@ -420,20 +420,13 @@ def format(self):
@format.setter
def format(self, format_string):

try:
prev_format = self._format # save current format string
except AttributeError: # nothing set at all yet
prev_format = None
prev_format = getattr(self, '_format', None)

self._format = format_string # set new format string

try:
# test whether it formats without error exemplarily
self.pformat(max_lines=1)

if self.dtype.kind == 'O':
# test whether it formats without error for all entries
self.pformat(max_lines=-1)
except TypeError as err:
# revert to restore previous format if there was one
self._format = prev_format
Expand Down

0 comments on commit dfd7e7a

Please sign in to comment.