Skip to content

Commit

Permalink
Do not stringify empty attributes sassoftware#12
Browse files Browse the repository at this point in the history
 * instead check first if the value exist and only stringify if this
   is the case (this avoids returning 'None' as string).

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
  • Loading branch information
pombredanne committed Jun 12, 2017
1 parent 18d45c6 commit bc77f53
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pymaven/pom.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,24 +355,24 @@ def properties(self):
if isinstance(self.parent, Artifact):
properties['parent.groupId'] = self.parent.group_id
properties['parent.artifactId'] = self.parent.artifact_id
properties['parent.version'] = str(self.parent.version)
properties['parent.version'] = self.parent.version and str(self.parent.version)
properties['project.parent.groupId'] = self.parent.group_id
properties['project.parent.artifactId'] = self.parent.artifact_id
properties['project.parent.version'] = str(self.parent.version)
properties['project.parent.version'] = self.parent.version and str(self.parent.version)
properties['pom.parent.groupId'] = self.parent.group_id
properties['pom.parent.artifactId'] = self.parent.artifact_id
properties['pom.parent.version'] = str(self.parent.version)
properties['pom.parent.version'] = self.parent.version and str(self.parent.version)

# built-in properties
properties['artifactId'] = self.artifact_id
properties['groupId'] = self.group_id
properties['version'] = str(self.version)
properties['version'] = self.version and str(self.version)
properties['project.artifactId'] = self.artifact_id
properties['project.groupId'] = self.group_id
properties['project.version'] = str(self.version)
properties['project.version'] = self.version and str(self.version)
properties['pom.artifactId'] = self.artifact_id
properties['pom.groupId'] = self.group_id
properties['pom.version'] = str(self.version)
properties['pom.version'] = self.version and str(self.version)

properties.update(self._find_properties())
properties.update(self._find_prerequisites())
Expand Down

0 comments on commit bc77f53

Please sign in to comment.