mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-29 07:24:25 +03:00
esim.saip.templates: Fix expand_default_value_pattern for length==0
The original code treated length==0 like length==None (unspecified), which is wrong. Change-Id: I39fa1e2b1b9d6d1c671ea37bdbec1d6f97e8a5e7
This commit is contained in:
@@ -117,9 +117,9 @@ class FileTemplate:
|
|||||||
|
|
||||||
def expand_default_value_pattern(self, length: Optional[int] = None) -> Optional[bytes]:
|
def expand_default_value_pattern(self, length: Optional[int] = None) -> Optional[bytes]:
|
||||||
"""Expand the default value pattern to the specified length."""
|
"""Expand the default value pattern to the specified length."""
|
||||||
if not length:
|
if length is None:
|
||||||
length = self._default_value_len()
|
length = self._default_value_len()
|
||||||
if not length:
|
if length is None:
|
||||||
raise ValueError("%s does not have a default length" % self)
|
raise ValueError("%s does not have a default length" % self)
|
||||||
if not self.default_val:
|
if not self.default_val:
|
||||||
return None
|
return None
|
||||||
|
|||||||
Reference in New Issue
Block a user