Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 2.6 : multiple context managers #2

Closed
frallain opened this issue Jan 9, 2013 · 2 comments
Closed

Python 2.6 : multiple context managers #2

frallain opened this issue Jan 9, 2013 · 2 comments

Comments

@frallain
Copy link

frallain commented Jan 9, 2013

Thanks for the fix, it works for one context manager but in the example below (with 2 context managers), I've got this exception :

Traceback (most recent call last):
  File "test.py", line 14, in <module>
    with html as root:
  File "C:\Users\l-fa229081.VRH026543\Downloads\python\hypertext\hypertext.py", line 78, in __get__
    return _per_thread.stack[-1].__exit__
IndexError: list index out of range
from hypertext import *

with div.content as root:
    h1.highlight("Welcome")
    TEXT("This is my page")
print root

with html as root:
    with head:
        meta(http_equiv="Content-Type", content="text/html; charset=utf-8")
        title("welcome to my page")
    with body:
        ATTR(id="body")
        with div.content(id = "floop", data_role = "page").pretty:
            TEXT("Hello, my <name> is")
            strong("Bob")
            TEXT("Also known as", em("Robert"))
            UNESCAPED("and I <b>like</b>")
            with ul:
                for item in ["cats", "rats", "hats"]:
                    li(item)
print root

Is it a normal behaviour ?

@tomerfiliba
Copy link
Owner

the new repo is https://github.com/tomerfiliba/srcgen...

@tomerfiliba
Copy link
Owner

fixed in tomerfiliba/srcgen#1

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants