From b713020a21c4bebde22b2dfdab9da56b7e3af01c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 1 Jan 2010 22:29:56 -0700 Subject: [PATCH] Create empty ipythonrc.ini before launching ipython shell --- src/calibre/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/calibre/__init__.py b/src/calibre/__init__.py index f63bbd9ade..4eeac6a159 100644 --- a/src/calibre/__init__.py +++ b/src/calibre/__init__.py @@ -455,9 +455,10 @@ def ipython(user_ns=None): os.environ['IPYTHONDIR'] = ipydir if not os.path.exists(ipydir): os.makedirs(ipydir) - rc = os.path.join(ipydir, 'ipythonrc') - if not os.path.exists(rc): - open(rc, 'wb').write(' ') + for x in ('', '.ini'): + rc = os.path.join(ipydir, 'ipythonrc'+x) + if not os.path.exists(rc): + open(rc, 'wb').write(' ') UC = ''' import IPython.ipapi ip = IPython.ipapi.get()