forked from pool/python-unify
- Add patch no-more-lib2to3.patch: * Don't use lib2to3, use the tokenize module. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-unify?expand=0&rev=18
16 lines
664 B
Diff
16 lines
664 B
Diff
Index: unify-0.5/unify.py
|
|
===================================================================
|
|
--- unify-0.5.orig/unify.py
|
|
+++ unify-0.5/unify.py
|
|
@@ -122,8 +122,8 @@ def detect_encoding(filename):
|
|
"""Return file encoding."""
|
|
try:
|
|
with open(filename, 'rb') as input_file:
|
|
- from lib2to3.pgen2 import tokenize as lib2to3_tokenize
|
|
- encoding = lib2to3_tokenize.detect_encoding(input_file.readline)[0]
|
|
+ import tokenize
|
|
+ encoding = tokenize.detect_encoding(input_file.readline)[0]
|
|
|
|
# Check for correctness of encoding.
|
|
with open_with_encoding(filename, encoding) as input_file:
|