Commit 4479bf15 authored by Stefan Behnel's avatar Stefan Behnel

fix some pylint findings

parent 1d39ec01
...@@ -5,14 +5,14 @@ ...@@ -5,14 +5,14 @@
from __future__ import absolute_import from __future__ import absolute_import
import os
import platform
import cython import cython
cython.declare(make_lexicon=object, lexicon=object, cython.declare(make_lexicon=object, lexicon=object,
print_function=object, error=object, warning=object, print_function=object, error=object, warning=object,
os=object, platform=object) os=object, platform=object)
import os
import platform
from .. import Utils from .. import Utils
from ..Plex.Scanners import Scanner from ..Plex.Scanners import Scanner
from ..Plex.Errors import UnrecognizedInput from ..Plex.Errors import UnrecognizedInput
...@@ -68,7 +68,7 @@ class Method(object): ...@@ -68,7 +68,7 @@ class Method(object):
class CompileTimeScope(object): class CompileTimeScope(object):
def __init__(self, outer = None): def __init__(self, outer=None):
self.entries = {} self.entries = {}
self.outer = outer self.outer = outer
...@@ -97,8 +97,7 @@ class CompileTimeScope(object): ...@@ -97,8 +97,7 @@ class CompileTimeScope(object):
def initial_compile_time_env(): def initial_compile_time_env():
benv = CompileTimeScope() benv = CompileTimeScope()
names = ('UNAME_SYSNAME', 'UNAME_NODENAME', 'UNAME_RELEASE', names = ('UNAME_SYSNAME', 'UNAME_NODENAME', 'UNAME_RELEASE', 'UNAME_VERSION', 'UNAME_MACHINE')
'UNAME_VERSION', 'UNAME_MACHINE')
for name, value in zip(names, platform.uname()): for name, value in zip(names, platform.uname()):
benv.declare(name, value) benv.declare(name, value)
try: try:
...@@ -272,8 +271,8 @@ class StringSourceDescriptor(SourceDescriptor): ...@@ -272,8 +271,8 @@ class StringSourceDescriptor(SourceDescriptor):
if not encoding: if not encoding:
return self.codelines return self.codelines
else: else:
return [ line.encode(encoding, error_handling).decode(encoding) return [line.encode(encoding, error_handling).decode(encoding)
for line in self.codelines ] for line in self.codelines]
def get_description(self): def get_description(self):
return self.name return self.name
...@@ -487,7 +486,7 @@ class PyrexScanner(Scanner): ...@@ -487,7 +486,7 @@ class PyrexScanner(Scanner):
else: else:
self.expected(what, message) self.expected(what, message)
def expected(self, what, message = None): def expected(self, what, message=None):
if message: if message:
self.error(message) self.error(message)
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment