Issue #8 resolved

Python 3 incompatibilities

Anonymous avatarAnonymous created an issue

Hey,

I'm trying to run poole on archlinux, but when I'm starting the process with :

$ poole.py --init 

I have this error :

File "/usr/bin/poole/poole.py", line 399
exec stmt in macros.copy()
        ^
SyntaxError: invalid syntax

I've installed the poole directory in /usr/bin/ and update my path like that :

$ export PATH=$PATH:/usr/bin/poole

My site directory is in my dropbox in my home folder.

Python v3.2.2-2 is installed on my computer as well as python-markdown.

Any idea about this error ?

Thanks in advance,

Léo

Comments (6)

  1. Oben Sonne
    • changed status to open

    The problem here is that exec isn't a keyword anymore in Python 3 but a plain function. In other words, the exec ... syntax works only until Python 2.7.

    I try to make this Python 3 friendly ASAP. In the meantime you might run poole with a Python 2.7 installation.

  2. Oben Sonne

    Python 2/3 hack for the exec statement/function

    See http://docs.python.org/release/3.0.1/whatsnew/3.0.html for changes with regard to `exec`. The problem here is that we cannot use the function syntax in Poole already for Python 2.x since we need a qualified exec, and thus we need the `in` syntax which causes a syntax error in Py3.

    This workaround uses `execfile` in Py2 (which, as a function, does not cause syntax errors in Py3) and the `exec` function from the builtins in Py3.

    References issue 8.

    e529749635df

  3. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.