From 3ec4d2f08b25d941c994bfcfa78f9a9f19241d13 2007-08-27 17:51:15 From: vivainio Date: 2007-08-27 17:51:15 Subject: [PATCH] fix cd to nonexistent dir when dhist is empty, close \#180 --- diff --git a/IPython/Magic.py b/IPython/Magic.py index 44ed8f8..04d2b64 100644 --- a/IPython/Magic.py +++ b/IPython/Magic.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Magic functions for InteractiveShell. -$Id: Magic.py 2668 2007-08-24 17:10:46Z vivainio $""" +$Id: Magic.py 2675 2007-08-27 17:51:15Z vivainio $""" #***************************************************************************** # Copyright (C) 2001 Janko Hauser and @@ -2517,7 +2517,7 @@ Defaulting color scheme to 'NoColor'""" dhist = self.shell.user_ns['_dh'] dhist.append(cwd) self.db['dhist'] = compress_dhist(dhist)[-100:] - if not 'q' in opts: + if not 'q' in opts and self.shell.user_ns['_dh']: print self.shell.user_ns['_dh'][-1] diff --git a/doc/ChangeLog b/doc/ChangeLog index 2e35842..7eb2537 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2007-08-27 Ville Vainio + + * Magic.py: fix %cd for nonexistent dir when dhist is empty, close #180 + 2007-08-26 Ville Vainio * ipmaker.py: Command line args have the highest priority again