Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.

Commit 310cbac

Browse files
Removed unneeded lines and call to OrNone
1 parent fa15735 commit 310cbac

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

parse.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,13 @@ func ParseReader(file io.Reader) ([]Command, error) {
8282
}
8383

8484
cmd.Json = child.Attributes["json"]
85-
8685
for n := child.Next; n != nil; n = n.Next {
8786
cmd.Value = append(cmd.Value, n.Value)
8887
}
8988

9089
if len(child.Heredocs) != 0 {
9190
// For heredocs, add heredocs extra lines to Original,
92-
// and each content to the Value array.
91+
// and to the heredocs list.
9392
cmd.Original = cmd.Original + "\n"
9493
for _, heredoc := range child.Heredocs {
9594
cmd.Original = cmd.Original + heredoc.Content + heredoc.Name + "\n"

pylib/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func heredocsToPy(heredocs []dockerfile.Heredoc) *C.PyObject {
8888

8989
pyFileDescriptor := C.PyLong_FromLong(C.long(heredoc.FileDescriptor))
9090

91-
pyContent := stringToPyOrNone(heredoc.Content)
91+
pyContent := stringToPy(heredoc.Content)
9292
if pyContent == nil {
9393
decrefAll()
9494
return nil
@@ -125,7 +125,6 @@ func cmdsToPy(cmds []dockerfile.Command) *C.PyObject {
125125
C.Py_DecRef(pyValue)
126126
C.Py_DecRef(pyHeredocs)
127127
C.Py_DecRef(ret)
128-
129128
}
130129

131130
ret = C.PyTuple_New(C.Py_ssize_t(len(cmds)))

0 commit comments

Comments
 (0)