Skip to content

Commit

Permalink
python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
malb committed Apr 15, 2017
1 parent 87751d0 commit bc778e1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@
import os
import shlex

from itertools import ifilter
try:
from itertools import ifilter as filter
except ImportError:
pass # python 3

from ast import parse

with open(os.path.join('..', 'src', 'fpylll', '__init__.py')) as f:
__version__ = parse(next(ifilter(lambda line: line.startswith('__version__'), f))).body[0].value.s
__version__ = parse(next(filter(lambda line: line.startswith('__version__'), f))).body[0].value.s


# If extensions (or modules to document with autodoc) are in another directory,
Expand Down
8 changes: 6 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
import subprocess
import sys

from itertools import ifilter
try:
from itertools import ifilter as filter
except ImportError:
pass # python 3

from os import path
from ast import parse
from distutils.core import setup
Expand Down Expand Up @@ -126,7 +130,7 @@
# VERSION

with open(path.join('src', 'fpylll', '__init__.py')) as f:
__version__ = parse(next(ifilter(lambda line: line.startswith('__version__'), f))).body[0].value.s
__version__ = parse(next(filter(lambda line: line.startswith('__version__'), f))).body[0].value.s


# FIRE
Expand Down

0 comments on commit bc778e1

Please sign in to comment.