Skip to content

Commit

Permalink
Fixes unnamed append points.
Browse files Browse the repository at this point in the history
In `ConfigFile.compile()`, the variable `content` is used but not
initialized, which results in unnamed append points being deleted and
`insert_lines` being appended at the end instead. Due to the
undifferentiated `try/except` block around this, the error is silently
ignored.

This fix makes the `try/except` block only handle `ValueError`, which
would occur when there's no explicit append point.
  • Loading branch information
Patrice Peterson committed Jun 3, 2014
1 parent 5fc3e94 commit d2aac58
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/dots
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,8 @@ class ConfigFile(object):

# Check if we need to slice into the array to insert
try:
compiled = self.insert_at_ap(content, single_file)
except:
compiled = self.insert_at_ap(compiled, single_file)
except ValueError:
compiled += ['\n'] + single_file

# Handle merging in the named append points
Expand Down

0 comments on commit d2aac58

Please sign in to comment.