From 06d971ae4d627bff96bf7ef9152d9bd8b15bb4e7 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 23 Oct 2017 16:35:56 +0200 Subject: [PATCH] Update flake8 to 3.5.0 (#88) * Update flake8 from 3.4.1 to 3.5.0 * fix linting with flake8 3.5 --- pydantic/types.py | 8 ++++---- tests/requirements.txt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pydantic/types.py b/pydantic/types.py index fb5fa39..8918b7d 100644 --- a/pydantic/types.py +++ b/pydantic/types.py @@ -56,14 +56,14 @@ class ConstrainedStr(str): if value is None: raise TypeError('None is not an allow value') - l = len(value) - if cls.min_length is not None and l < cls.min_length: + v_len = len(value) + if cls.min_length is not None and v_len < cls.min_length: raise ValueError(f'length less than minimum allowed: {cls.min_length}') if cls.curtail_length: - if l > cls.curtail_length: + if v_len > cls.curtail_length: value = value[:cls.curtail_length] - elif cls.max_length is not None and l > cls.max_length: + elif cls.max_length is not None and v_len > cls.max_length: raise ValueError(f'length greater than maximum allowed: {cls.max_length}') if cls.regex: diff --git a/tests/requirements.txt b/tests/requirements.txt index 2153cff..44ca562 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,5 +1,5 @@ coverage==4.4.1 -flake8==3.4.1 +flake8==3.5.0 isort==4.2.15 mypy==0.540 pycodestyle==2.3.1