diff options
author | Eevee (Alex Munroe) <eevee.git@veekun.com> | 2013-08-13 14:09:57 -0700 |
---|---|---|
committer | Eevee (Alex Munroe) <eevee.git@veekun.com> | 2013-08-13 14:09:57 -0700 |
commit | 4e2ca8b53371ac5db597a8fdce88bb8b6f0d72a5 (patch) | |
tree | e0ebf3699cc4d1818f7c6e460b05ef166f619bd4 | |
parent | e1a4c457d457f4a553d83737ad9dd5b3a597d035 (diff) | |
download | pyscss-4e2ca8b53371ac5db597a8fdce88bb8b6f0d72a5.tar.gz |
String multiplication should check for integerity.
-rw-r--r-- | scss/types.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scss/types.py b/scss/types.py index cb0d90f..d38cc10 100644 --- a/scss/types.py +++ b/scss/types.py @@ -745,7 +745,11 @@ class String(Value): if not other.is_unitless: raise TypeError("Can only multiply strings by unitless numbers") - return String(self.value * other.value, quotes=self.quotes) + n = other.value + if n != int(n): + raise ValueError("Can only multiply strings by integers") + + return String(self.value * int(other.value), quotes=self.quotes) def render(self, compress=False): return self.__str__() |