Permalink
Browse files

Fix %env magic on Python 3.

Closes gh-1201
  • Loading branch information...
1 parent 47367a0 commit e913c0b0e2445954adda702424e337c31303ba6e @takluyver committed Apr 15, 2012
Showing with 4 additions and 1 deletion.
  1. +1 −1 IPython/core/magic.py
  2. +3 −0 IPython/core/tests/test_magic.py
View
2 IPython/core/magic.py
@@ -3006,7 +3006,7 @@ def magic_cd(self, parameter_s=''):
def magic_env(self, parameter_s=''):
"""List environment variables."""
- return os.environ.data
+ return dict(os.environ)
def magic_pushd(self, parameter_s=''):
"""Place the current dir on stack and change directory.
View
3 IPython/core/tests/test_magic.py
@@ -467,3 +467,6 @@ def test_notebook_reformat_json():
_ip.magic("notebook -f ipynb %s" % infile)
_ip.magic("notebook -f json %s" % infile)
+def test_env():
+ env = _ip.magic("env")
+ assert isinstance(env, dict), type(env)

0 comments on commit e913c0b

Please sign in to comment.