diff --git a/README.md b/README.md index 568ddcc..fa94c9c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -### NOTE: This project is no longer actively maintained. +# Why does this fork exist? +To fix the `rU` -> `r` in file reads. `rU` is now deprecated. # PyReact diff --git a/react/jsx.py b/react/jsx.py index 070c6f4..fafe2ea 100644 --- a/react/jsx.py +++ b/react/jsx.py @@ -22,7 +22,7 @@ class JSXTransformer(object): def __init__(self): path = react.source.path_for('JSXTransformer.js') - with open(path, 'rU') as f: + with open(path, 'r') as f: self.context = execjs.compile(f.read()) def transform_string(self, jsx, harmony=False, strip_types=False): @@ -47,7 +47,7 @@ def transform_string(self, jsx, harmony=False, strip_types=False): return js def transform(self, jsx_path, js_path=None, **kwargs): - with open(jsx_path, 'rU') as i: + with open(jsx_path, 'r') as i: js = self.transform_string(i.read(), **kwargs) if js_path: with open(js_path, 'wb') as o: diff --git a/react/test/jsx.py b/react/test/jsx.py index bd749bf..8a5751e 100644 --- a/react/test/jsx.py +++ b/react/test/jsx.py @@ -24,7 +24,7 @@ def test_transform(self): jsx_path = join(TEST_ROOT, 'files/test.jsx') js_path = join(TEST_ROOT, 'files/test.js') - with open(js_path, 'rU') as js: + with open(js_path, 'r') as js: self.assertEquals( jsx.transform(jsx_path), unicode(js.read()))