Python 3 compatibility for os.getcwdu()

This commit is contained in:
Thomas Kluyver 2013-10-31 12:37:45 -07:00
parent c4b9e69793
commit 557fb3f4ae
2 changed files with 5 additions and 5 deletions

View File

@ -16,8 +16,6 @@ Authors:
# Imports
#-----------------------------------------------------------------------------
import os
from tornado import web
from zmq.eventloop import ioloop
@ -26,6 +24,7 @@ from IPython.utils.traitlets import Dict, Instance, CFloat
from IPython.parallel.apps.ipclusterapp import IPClusterStart
from IPython.core.profileapp import list_profiles_in
from IPython.core.profiledir import ProfileDir
from IPython.utils import py3compat
from IPython.utils.path import get_ipython_dir
@ -74,7 +73,7 @@ class ClusterManager(LoggingConfigurable):
def update_profiles(self):
"""List all profiles in the ipython_dir and cwd.
"""
for path in [get_ipython_dir(), os.getcwdu()]:
for path in [get_ipython_dir(), py3compat.getcwd()]:
for profile in list_profiles_in(path):
pd = self.get_profile_dir(profile, path)
if profile not in self.profiles:

View File

@ -21,7 +21,8 @@ import os
from IPython.config.configurable import LoggingConfigurable
from IPython.nbformat import current
from IPython.utils.traitlets import List, Dict, Unicode, TraitError
from IPython.utils import py3compat
from IPython.utils.traitlets import Unicode, TraitError
#-----------------------------------------------------------------------------
# Classes
@ -35,7 +36,7 @@ class NotebookManager(LoggingConfigurable):
# 2. The cwd of the kernel for a project.
# Right now we use this attribute in a number of different places and
# we are going to have to disentangle all of this.
notebook_dir = Unicode(os.getcwdu(), config=True, help="""
notebook_dir = Unicode(py3compat.getcwd(), config=True, help="""
The directory to use for notebooks.
""")