8000 is_relaxed() always returns False on Windows, and no Task objects are created · Issue #5 · samizdatco/corduroy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

is_relaxed() always returns False on Windows, and no Task objects are created #5

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

Open
paavopere opened this issue Feb 15, 2014 · 0 comments

Comments

@paavopere
Copy link
paavopere commented Feb 15, 2014

On my Windows system, @relax didn't make Task objects out of any query, and I suppose this problem arises on any Windows system, like in issue #1 .

I traced the issue back to the is_relaxed() function in io.py module (issue #3 made debugging a bit tricky):

def is_relaxed():
    for _, filename, _, function_name, _, _ in getouterframes(currentframe())[:30]:
        if 'tornado/gen.py' in filename:
            return True # Task()...
    return False

Now, Windows uses backslashes in paths so 'tornado/gen.py' in filename is always False. I did a quick fix on my dev machine to change that line to work on Windows as well, and now Task objects are correctly created:

def is_relaxed():
    for _, filename, _, function_name, _, _ in getouterframes(currentframe())[:30]:
        if 'tornado/gen.py' in filename or 'tornado\\gen.py' in filename:
            return True # Task()...
    return False

Obviously, if there are similar file path matches somewhere else in the code (I haven't come across) with forward slashes only, they would get the same treatment. I'm not sure if matching a string in the filename of current frame is the optimal way to do that anyway, but that fix would enable developing on Windows.

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

1 participant
0