|
98 | 98 | Any, Dict, Unicode, Integer, List, Bool, Bytes, Instance, |
99 | 99 | TraitError, Type, Float, observe, default, validate |
100 | 100 | ) |
101 | | -from ipython_genutils import py3compat |
102 | 101 | from jupyter_core.paths import jupyter_runtime_dir, jupyter_path |
103 | 102 | from jupyter_server._sysinfo import get_sys_info |
104 | 103 |
|
@@ -195,7 +194,7 @@ def init_settings(self, jupyter_app, kernel_manager, contents_manager, |
195 | 194 | "template_path", |
196 | 195 | jupyter_app.template_file_path, |
197 | 196 | ) |
198 | | - if isinstance(_template_path, py3compat.string_types): |
| 197 | + if isinstance(_template_path, str): |
199 | 198 | _template_path = (_template_path,) |
200 | 199 | template_path = [os.path.expanduser(path) for path in _template_path] |
201 | 200 |
|
@@ -223,7 +222,7 @@ def init_settings(self, jupyter_app, kernel_manager, contents_manager, |
223 | 222 | now = utcnow() |
224 | 223 |
|
225 | 224 | root_dir = contents_manager.root_dir |
226 | | - home = py3compat.str_to_unicode(os.path.expanduser('~'), encoding=sys.getfilesystemencoding()) |
| 225 | + home = os.path.expanduser("~") |
227 | 226 | if root_dir.startswith(home + os.path.sep): |
228 | 227 | # collapse $HOME to ~ |
229 | 228 | root_dir = '~' + root_dir[len(home):] |
@@ -925,8 +924,6 @@ def _default_allow_remote(self): |
925 | 924 | # Address is a hostname |
926 | 925 | for info in socket.getaddrinfo(self.ip, self.port, 0, socket.SOCK_STREAM): |
927 | 926 | addr = info[4][0] |
928 | | - if not py3compat.PY3: |
929 | | - addr = addr.decode('ascii') |
930 | 927 |
|
931 | 928 | try: |
932 | 929 | parsed = ipaddress.ip_address(addr.split('%')[0]) |
@@ -1258,7 +1255,7 @@ def _default_root_dir(self): |
1258 | 1255 | self._root_dir_set = True |
1259 | 1256 | return os.path.dirname(os.path.abspath(self.file_to_run)) |
1260 | 1257 | else: |
1261 | | - return py3compat.getcwd() |
| 1258 | + return os.getcwd() |
1262 | 1259 |
|
1263 | 1260 | @validate('root_dir') |
1264 | 1261 | def _root_dir_validate(self, proposal): |
|
0 commit comments