python3 support: pylint, W1649 # (deprecated-string-function) Accessing a deprecated function on the string module
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Thu, 11 Oct 2018 10:01:12 +0300
changeset 2448 1367b796e129
parent 2447 1c04a50dc7ff
child 2449 b0560adec4b7
python3 support: pylint, W1649 # (deprecated-string-function) Accessing a deprecated function on the string module
plcopen/structures.py
tests/tools/check_source.sh
--- a/plcopen/structures.py	Thu Oct 11 09:41:15 2018 +0300
+++ b/plcopen/structures.py	Thu Oct 11 10:01:12 2018 +0300
@@ -24,7 +24,6 @@
 
 
 from __future__ import absolute_import
-import string
 import re
 from collections import OrderedDict
 
@@ -104,7 +103,10 @@
     """
     take a .csv file and translate it it a "csv_table"
     """
-    return [map(string.strip, line.split(';')) for line in file.readlines()]
+    table = [[column.strip()
+              for column in line.split(';')]
+             for line in file.readlines()]
+    return table
 
 
 def find_section(section_name, table):
--- a/tests/tools/check_source.sh	Thu Oct 11 09:41:15 2018 +0300
+++ b/tests/tools/check_source.sh	Thu Oct 11 10:01:12 2018 +0300
@@ -367,6 +367,7 @@
     enable=$enable,W1602          # (basestring-builtin) basestring built-in referenced
     enable=$enable,W1646          # (invalid-str-codec) non-text encoding used in str.decode
     enable=$enable,W1645          # (exception-message-attribute) Exception.message removed in Python 3
+    enable=$enable,W1649          # (deprecated-string-function) Accessing a deprecated function on the string module
     # enable=
 
     options=