|
95 | 95 | Any, Dict, Unicode, Integer, List, Bool, Bytes, Instance,
|
96 | 96 | TraitError, Type, Float, observe, default, validate
|
97 | 97 | )
|
98 |
| -from ipython_genutils import py3compat |
99 | 98 | from jupyter_core.paths import jupyter_runtime_dir, jupyter_path
|
100 | 99 | from jupyter_server._sysinfo import get_sys_info
|
101 | 100 |
|
@@ -201,7 +200,7 @@ def init_settings(self, jupyter_app, kernel_manager, contents_manager,
|
201 | 200 | "template_path",
|
202 | 201 | jupyter_app.template_file_path,
|
203 | 202 | )
|
204 |
| - if isinstance(_template_path, py3compat.string_types): |
| 203 | + if isinstance(_template_path, str): |
205 | 204 | _template_path = (_template_path,)
|
206 | 205 | template_path = [os.path.expanduser(path) for path in _template_path]
|
207 | 206 |
|
@@ -229,7 +228,7 @@ def init_settings(self, jupyter_app, kernel_manager, contents_manager,
|
229 | 228 | now = utcnow()
|
230 | 229 |
|
231 | 230 | root_dir = contents_manager.root_dir
|
232 |
| - home = py3compat.str_to_unicode(os.path.expanduser('~'), encoding=sys.getfilesystemencoding()) |
| 231 | + home = os.path.expanduser("~") |
233 | 232 | if root_dir.startswith(home + os.path.sep):
|
234 | 233 | # collapse $HOME to ~
|
235 | 234 | root_dir = '~' + root_dir[len(home):]
|
@@ -953,8 +952,6 @@ def _default_allow_remote(self):
|
953 | 952 | # Address is a hostname
|
954 | 953 | for info in socket.getaddrinfo(self.ip, self.port, 0, socket.SOCK_STREAM):
|
955 | 954 | addr = info[4][0]
|
956 |
| - if not py3compat.PY3: |
957 |
| - addr = addr.decode('ascii') |
958 | 955 |
|
959 | 956 | try:
|
960 | 957 | parsed = ipaddress.ip_address(addr.split('%')[0])
|
@@ -1281,7 +1278,7 @@ def _default_root_dir(self):
|
1281 | 1278 | self._root_dir_set = True
|
1282 | 1279 | return os.path.dirname(os.path.abspath(self.file_to_run))
|
1283 | 1280 | else:
|
1284 |
| - return py3compat.getcwd() |
| 1281 | + return os.getcwd() |
1285 | 1282 |
|
1286 | 1283 | @validate('root_dir')
|
1287 | 1284 | def _root_dir_validate(self, proposal):
|
|
0 commit comments