Skip to content

Commit 2641b64

Browse files
author
Sai Rahul Poruri
committed
CLN : Remove code for unsupported python versions
specifically, code which was handling python 2.x and < 3.4 modified: notebook/base/zmqhandlers.py modified: notebook/services/contents/tests/test_manager.py modified: notebook/tests/test_serverextensions.py
1 parent 2ba2960 commit 2641b64

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
@@ -41,8 +41,6 @@ def serialize_binary_message(msg):
4141
# don't modify msg or buffer list in-place
4242
msg = msg.copy()
4343
buffers = list(msg.pop('buffers'))
44-
if sys.version_info < (3, 4):
45-
buffers = [x.tobytes() for x in buffers]
4644
bmsg = json.dumps(msg, default=date_default).encode('utf8')
4745
buffers.insert(0, bmsg)
4846
nbufs = len(buffers)

notebook/services/contents/tests/test_manager.py

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

111-
@dec.skipif(sys.platform == 'win32' and sys.version_info[0] < 3)
112111
def test_bad_symlink(self):
113112
with TemporaryDirectory() as td:
114113
cm = FileContentsManager(root_dir=td)
@@ -149,7 +148,6 @@ def test_recursive_symlink(self):
149148
# recursive symlinks should not be shown in the contents manager
150149
self.assertNotIn('recursive', contents)
151150

152-
@dec.skipif(sys.platform == 'win32' and sys.version_info[0] < 3)
153151
def test_good_symlink(self):
154152
with TemporaryDirectory() as td:
155153
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)