Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stay Python 2.6 compatible #62

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
language: python
python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"

matrix:
include:
- os: linux
python: 2.6
cache: pip
Elias481 marked this conversation as resolved.
Show resolved Hide resolved
- os: linux
python: 2.7
- os: linux
python: 3.3
- os: linux
python: 3.4
- os: linux
python: 3.5
install:
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install pycparser==2.18; pip install unittest2; fi
- pip install -r requirements.txt
- pip install coveralls
script: nosetests -s -v --with-coverage --cover-package=inotify
Expand Down
4 changes: 2 additions & 2 deletions inotify/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def _handle_inotify_event(self, wd):

header = _INOTIFY_EVENT(*header_raw)
type_names = self._get_event_names(header.mask)
_LOGGER.debug("Events received in stream: {}".format(type_names))
_LOGGER.debug("Events received in stream: {0}".format(type_names))
Elias481 marked this conversation as resolved.
Show resolved Hide resolved

event_length = (_STRUCT_HEADER_LENGTH + header.len)
if length < event_length:
Expand Down Expand Up @@ -225,7 +225,7 @@ def event_gen(
# (fd) looks to always match the inotify FD.

names = self._get_event_names(event_type)
_LOGGER.debug("Events received from epoll: {}".format(names))
_LOGGER.debug("Events received from epoll: {0}".format(names))
Elias481 marked this conversation as resolved.
Show resolved Hide resolved

for (header, type_names, path, filename) \
in self._handle_inotify_event(fd):
Expand Down
6 changes: 5 additions & 1 deletion tests/test_inotify.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# -*- coding: utf-8 -*-

import os
import unittest
import sys
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest

import inotify.constants
import inotify.adapters
Expand Down