Skip to content

Commit b324004

Browse files
author
Ryan Munro
authored
Remove six dependency (#5)
Remove six dependency
2 parents 6000784 + f173d52 commit b324004

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ language: python
22
os:
33
- "linux"
44
env:
5+
- NODE_VERSION="7.5"
6+
- NODE_VERSION="7.3"
7+
- NODE_VERSION="7.2"
8+
- NODE_VERSION="7.1"
9+
- NODE_VERSION="7.0"
510
- NODE_VERSION="6.1"
611
- NODE_VERSION="6.0"
712
- NODE_VERSION="5.11"
@@ -35,7 +40,6 @@ before_install:
3540
- source ~/.nvm/nvm.sh
3641
- nvm install $NODE_VERSION
3742
install:
38-
- pip install six
3943
- npm install
4044
before_script:
4145
- python -V

node_python_bridge.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
from __future__ import unicode_literals
22

3-
import six
43
import os
54
import sys
65
import json
76
import traceback
87

98
NODE_CHANNEL_FD = int(os.environ['NODE_CHANNEL_FD'])
9+
UNICODE_TYPE = unicode if sys.version_info[0] == 2 else str
1010

1111

1212
def format_exception(t=None, e=None, tb=None):
@@ -44,7 +44,7 @@ def format_exception(t=None, e=None, tb=None):
4444
# Assert data saneness
4545
if data['type'] not in ['execute', 'evaluate']:
4646
raise Exception('Python bridge call `type` must be `execute` or `evaluate`')
47-
if not isinstance(data['code'], six.string_types):
47+
if not isinstance(data['code'], UNICODE_TYPE):
4848
raise Exception('Python bridge call `code` must be a string.')
4949

5050
# Run Python code

0 commit comments

Comments
 (0)