summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEevee <eevee.git@veekun.com>2013-06-26 17:41:01 -0700
committerEevee <eevee.git@veekun.com>2013-06-26 17:41:01 -0700
commitdff9fb7ca0dc5875c0e8288bf1df7054d99d7685 (patch)
tree7215e6a7f71d40b9685e82923ca49af83998575b
parent6c5ca3bb2a55442b2214cd6f52192da79936e498 (diff)
downloadpyscss-dff9fb7ca0dc5875c0e8288bf1df7054d99d7685.tar.gz
Remove some _undefined_re checks from type system.
Literal 'undefined' strings should no longer be possible, now that the parser recognizes them and there's a null type.
-rw-r--r--scss/types.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/scss/types.py b/scss/types.py
index 9b4cb19..c579efe 100644
--- a/scss/types.py
+++ b/scss/types.py
@@ -3,7 +3,7 @@ from __future__ import absolute_import
import colorsys
import operator
-from scss.cssdefs import _conv_factor, _conv_type, _undefined_re, _units_weights
+from scss.cssdefs import _conv_factor, _conv_type, _units_weights
from scss.util import dequote, escape, to_float, to_str
@@ -138,8 +138,6 @@ class NumberValue(Value):
type = None
elif isinstance(tokens, (StringValue, basestring)):
tokens = getattr(tokens, 'value', tokens)
- if _undefined_re.match(tokens):
- raise ValueError("Value is not a Number! (%s)" % tokens)
try:
if tokens and tokens[-1] == '%':
self.value = to_float(tokens[:-1]) / 100.0
@@ -408,8 +406,6 @@ class ListValue(Value):
def first(self):
for v in self.values():
- if isinstance(v, basestring) and _undefined_re.match(v):
- continue
if bool(v):
return v
return v
@@ -467,8 +463,6 @@ class ColorValue(Value):
tokens = tokens.value
tokens = to_str(tokens)
tokens.replace(' ', '').lower()
- if _undefined_re.match(tokens):
- raise ValueError("Value is not a Color! (%s)" % tokens)
try:
self.value = self.HEX2RGBA[len(tokens)](tokens)
except: