summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEevee (Alex Munroe) <eevee.git@veekun.com>2013-08-13 14:09:57 -0700
committerEevee (Alex Munroe) <eevee.git@veekun.com>2013-08-13 14:09:57 -0700
commit4e2ca8b53371ac5db597a8fdce88bb8b6f0d72a5 (patch)
treee0ebf3699cc4d1818f7c6e460b05ef166f619bd4
parente1a4c457d457f4a553d83737ad9dd5b3a597d035 (diff)
downloadpyscss-4e2ca8b53371ac5db597a8fdce88bb8b6f0d72a5.tar.gz
String multiplication should check for integerity.
-rw-r--r--scss/types.py6
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__()