masatana commented on a change in pull request #865:
URL: https://github.com/apache/avro/pull/865#discussion_r416704537



##########
File path: lang/py/avro/__init__.py
##########
@@ -19,4 +19,14 @@
 
 from __future__ import absolute_import, division, print_function
 
+import os
+
 __all__ = ['schema', 'io', 'datafile', 'protocol', 'ipc', 'constants', 
'timezones', 'codecs']
+
+def LoadResource(name):
+  dir_path = os.path.dirname(__file__)
+  rsrc_path = os.path.join(dir_path, name)
+  with open(rsrc_path, 'r') as f:
+    return f.read()
+
+__version__ = LoadResource('VERSION.txt').strip()

Review comment:
       Thanks for the review! I refactored the code with your suggestd code.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to