Plugins/CheckerPlugins/CodeStyleChecker/MiscellaneousChecker.py

changeset 6247
5c677a7f7d51
parent 6188
5a6ae3be31e6
child 6645
ad476851d7e0
equal deleted inserted replaced
6246:fe07a9f16f23 6247:5c677a7f7d51
251 251
252 @return tuple containing the line number and the coding 252 @return tuple containing the line number and the coding
253 @rtype tuple of int and str 253 @rtype tuple of int and str
254 """ 254 """
255 for lineno, line in enumerate(self.__source[:5]): 255 for lineno, line in enumerate(self.__source[:5]):
256 matched = re.search('coding[:=]\s*([-\w_.]+)', line, re.IGNORECASE) 256 matched = re.search(r'coding[:=]\s*([-\w_.]+)',
257 line, re.IGNORECASE)
257 if matched: 258 if matched:
258 return lineno, matched.group(1) 259 return lineno, matched.group(1)
259 else: 260 else:
260 return 0, "" 261 return 0, ""
261 262

eric ide

mercurial