Skip to content

Commit

Permalink
[fix] overwriting of ipython_behavior was broken
Browse files Browse the repository at this point in the history
  • Loading branch information
Psycojoker committed Mar 29, 2016
1 parent 9e77259 commit c7b5e65
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 4 additions & 1 deletion redbaron/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from redbaron.redbaron import *
from redbaron.utils import *
from redbaron.private_config import *
from redbaron.base_nodes import *
from redbaron.nodes import *

Expand All @@ -11,5 +10,9 @@
DEBUG = False
ALL_IDENTIFIERS = set()

ipython_behavior = True
force_ipython_behavior = False


for name in list(filter(lambda x: x.endswith("Node"), dir(nodes))):
list(map(ALL_IDENTIFIERS.add, filter(None, getattr(nodes, name).generate_identifiers())))
10 changes: 6 additions & 4 deletions redbaron/private_config.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
ipython_behavior = True
force_ipython_behavior = False
from __future__ import absolute_import

import redbaron


def runned_from_ipython():
# for testing
if force_ipython_behavior:
if redbaron.force_ipython_behavior:
return True

if not ipython_behavior:
if not redbaron.ipython_behavior:
return False
try:
__IPYTHON__
Expand Down

0 comments on commit c7b5e65

Please sign in to comment.