Skip to content

Commit 913f5a1

Browse files
committed
Fix travis-ci builds for python2.6
1 parent cd3e65d commit 913f5a1

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ python:
55
- pypy
66
install:
77
- python setup.py install
8+
- pip install unittest2
89
script:
910
- python test_replays/test_all.py
1011
- python test_s2gs/test_all.py
12+
branches:
13+
only:
14+
- master
1115
notifications:
1216
irc: "chat.freenode.net#sc2reader"

test_replays/test_all.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22

33
import datetime
44
import json
5-
import unittest
5+
6+
# Newer unittest features aren't built in for python 2.6
7+
import sys
8+
if sys.version_info[:2] <= (2, 7):
9+
import unittest2 as unittest
10+
else:
11+
import unittest
612

713
import sc2reader
814
sc2reader.log_utils.log_to_console("INFO")

test_s2gs/test_all.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# -*- coding: UTF-8 -*-
22

3-
import unittest
3+
# Newer unittest features aren't built in for python 2.6
4+
import sys
5+
if sys.version_info[:2] <= (2, 7):
6+
import unittest2 as unittest
7+
else:
8+
import unittest
49

510
import sc2reader
611
sc2reader.log_utils.log_to_console("INFO")

0 commit comments

Comments
 (0)