diff options
Diffstat (limited to 'pystache')
-rw-r--r-- | pystache/__init__.py | 2 | ||||
-rw-r--r-- | pystache/parser.py | 4 | ||||
-rw-r--r-- | pystache/tests/common.py | 6 | ||||
-rw-r--r-- | pystache/tests/main.py | 1 |
4 files changed, 8 insertions, 5 deletions
diff --git a/pystache/__init__.py b/pystache/__init__.py index 4cf2434..ff3150f 100644 --- a/pystache/__init__.py +++ b/pystache/__init__.py @@ -10,4 +10,4 @@ from pystache.init import parse, render, Renderer, TemplateSpec __all__ = ['parse', 'render', 'Renderer', 'TemplateSpec'] -__version__ = '0.5.4' # Also change in setup.py. +__version__ = '0.6.0-alpha' # Also change in setup.py. diff --git a/pystache/parser.py b/pystache/parser.py index 9a4fba2..aa7190f 100644 --- a/pystache/parser.py +++ b/pystache/parser.py @@ -12,7 +12,7 @@ from pystache.parsed import ParsedTemplate END_OF_LINE_CHARACTERS = [u'\r', u'\n'] -NON_BLANK_RE = re.compile(ur'^(.)', re.M) +NON_BLANK_RE = re.compile(u'^(.)', re.M) # TODO: add some unit tests for this. @@ -147,7 +147,7 @@ class _PartialNode(object): def render(self, engine, context): template = engine.resolve_partial(self.key) # Indent before rendering. - template = re.sub(NON_BLANK_RE, self.indent + ur'\1', template) + template = re.sub(NON_BLANK_RE, self.indent + u'\\1', template) return engine.render(template, context) diff --git a/pystache/tests/common.py b/pystache/tests/common.py index 222e14f..c87e26e 100644 --- a/pystache/tests/common.py +++ b/pystache/tests/common.py @@ -232,6 +232,8 @@ class Attachable(object): setattr(self, arg, value) def __repr__(self): + # Sort self.__args__.iteritems() so that repr() does not depend on + # Python's hash seed (e.g. PYTHONHASHSEED). return "%s(%s)" % (self.__class__.__name__, - ", ".join("%s=%s" % (k, repr(v)) - for k, v in self.__args__.iteritems())) + ", ".join("%s=%s" % (k, repr(v)) for k, v in + sorted(self.__args__.iteritems()))) diff --git a/pystache/tests/main.py b/pystache/tests/main.py index 8af6b2e..eefeca2 100644 --- a/pystache/tests/main.py +++ b/pystache/tests/main.py @@ -89,6 +89,7 @@ def main(sys_argv): """ # TODO: use logging module print "pystache: running tests: argv: %s" % repr(sys_argv) + print "pystache: PYTHONHASHSEED: %r" % os.getenv('PYTHONHASHSEED') should_source_exist = False spec_test_dir = None |