Skip to content

Commit

Permalink
prepare 0.5.7; minor python 3 improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
barseghyanartur committed Aug 3, 2015
1 parent 1bd4a8b commit 9aecca3
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ are used for versioning (schema follows below):
0.3.4 to 0.4).
- All backwards incompatible changes are mentioned in this document.

0.5.7
-----
2015-08-03

- Minor Python 3 improvements.

0.5.6
-----
2015-07-31
Expand Down
2 changes: 1 addition & 1 deletion ROADMAP.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ change of the name of the "simple" theme into "django_admin_style" theme.
- Internally, make a date when form has been created. Also keep track of when
the form has been last edited.

0.5.7
0.5.8
-----
yyyy-mm-dd (upcoming).

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
for locale_dir in locale_dirs:
locale_files += [os.path.join(locale_dir, f) for f in os.listdir(locale_dir)]

version = '0.5.6'
version = '0.5.7'

install_requires = [
'Pillow>=2.0.0',
Expand Down
4 changes: 2 additions & 2 deletions src/fobi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__title__ = 'django-fobi'
__version__ = '0.5.6'
__build__ = 0x00003b
__version__ = '0.5.7'
__build__ = 0x00003c
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
__copyright__ = '2014-2015 Artur Barseghyan'
__license__ = 'GPL 2.0/LGPL 2.1'
Expand Down
17 changes: 13 additions & 4 deletions src/fobi/discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@

import imp
import logging
import sys

import six

if six.PY3:
import sys
sys.setrecursionlimit(1500)

from django.conf import settings

from nine.versions import DJANGO_GTE_1_7
Expand Down Expand Up @@ -49,6 +46,15 @@ def autodiscover():
"""
Auto-discovers files that should be found by fobi.
"""
# For Python 3 we need to increase the recursion limit, otherwise things
# break. What we want is to set the recursion limit back to its' initial
# value after all plugins have been discovered.
recursion_limit = 1500
default_recursion_limit = sys.getrecursionlimit()

if six.PY3 and recursion_limit > default_recursion_limit:
sys.setrecursionlimit(recursion_limit)

FORM_ELEMENT_PLUGINS_MODULE_NAME = get_setting(
'FORM_ELEMENT_PLUGINS_MODULE_NAME'
)
Expand All @@ -74,3 +80,6 @@ def autodiscover():

# Do not yet discover form importers
#autodiscover_modules(FORM_IMPORTER_PLUGINS_MODULE_NAME)

if six.PY3 and recursion_limit > default_recursion_limit:
sys.setrecursionlimit(default_recursion_limit)

0 comments on commit 9aecca3

Please sign in to comment.