Skip to content

Commit 545dbab

Browse files
authored
Merge pull request #5807 from rahulporuri/cln/remove-dead-code
Remove code for unsupported python versions
2 parents 18e4834 + 2641b64 commit 545dbab

File tree

3 files changed

+1
-9
lines changed

3 files changed

+1
-9
lines changed

notebook/base/zmqhandlers.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ def serialize_binary_message(msg):
4040
# don't modify msg or buffer list in-place
4141
msg = msg.copy()
4242
buffers = list(msg.pop('buffers'))
43-
if sys.version_info < (3, 4):
44-
buffers = [x.tobytes() for x in buffers]
4543
bmsg = json.dumps(msg, default=date_default).encode('utf8')
4644
buffers.insert(0, bmsg)
4745
nbufs = len(buffers)

notebook/services/contents/tests/test_manager.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ def test_checkpoint_subdir(self):
106106
self.assertEqual(cp_dir, os.path.join(root, cpm.checkpoint_dir, cp_name))
107107
self.assertEqual(cp_subdir, os.path.join(root, subd, cpm.checkpoint_dir, cp_name))
108108

109-
@dec.skipif(sys.platform == 'win32' and sys.version_info[0] < 3)
110109
def test_bad_symlink(self):
111110
with TemporaryDirectory() as td:
112111
cm = FileContentsManager(root_dir=td)
@@ -147,7 +146,6 @@ def test_recursive_symlink(self):
147146
# recursive symlinks should not be shown in the contents manager
148147
self.assertNotIn('recursive', contents)
149148

150-
@dec.skipif(sys.platform == 'win32' and sys.version_info[0] < 3)
151149
def test_good_symlink(self):
152150
with TemporaryDirectory() as td:
153151
cm = FileContentsManager(root_dir=td)

notebook/tests/test_serverextensions.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@
1616
from notebook.notebookapp import NotebookApp
1717
from notebook.nbextensions import _get_config_dir
1818

19-
if sys.version_info > (3,):
20-
from types import SimpleNamespace
21-
else:
22-
class SimpleNamespace(object):
23-
pass
19+
from types import SimpleNamespace
2420

2521
from collections import OrderedDict
2622

0 commit comments

Comments
 (0)