Skip to content
This repository was archived by the owner on Jan 3, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,11 @@ matrix:
- python: "3.7"
dist: xenial # required for Python 3.7 (travis-ci/travis-ci#9069)
sudo: required # required for Python 3.7 (travis-ci/travis-ci#9069)
before_script:
- pip install flake8
# stop the build if there are Python syntax errors or undefined names
- flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
script:
- python setup.py test
2 changes: 1 addition & 1 deletion pythonparser/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ class RewriterConflict(Exception):

def __init__(self, first, second):
self.first, self.second = first, second
exception.__init__(self, "Ranges %s and %s overlap" % (repr(first), repr(second)))
Exception.__init__(self, "Ranges %s and %s overlap" % (repr(first), repr(second)))

class Rewriter:
"""
Expand Down
16 changes: 8 additions & 8 deletions pythonparser/test/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding:utf-8

from __future__ import absolute_import, division, print_function, unicode_literals
import sys


unicode = type("")

Expand All @@ -24,12 +24,12 @@ def __eq__(self, o):
def __ne__(self, o):
return not self == o

if sys.version_info >= (3,):
LongOnly = int
else:
class LongOnly(long):
try:
class LongOnly(long): # Python 2
def __eq__(self, o):
return isinstance(o, long) and long.__cmp__(self, o) == 0
return isinstance(o, long) and long.__cmp__(self, o) == 0 # noqa

def __ne__(self, o):
return not self == o
def __ne__(self, o):
return not self == o
except NameError: # Python 3
LongOnly = int