Hannah-Jiang commented on a change in pull request #11265: Fix a Py2/3 
incompatibility in profiler.
URL: https://github.com/apache/beam/pull/11265#discussion_r400483969
 
 

 ##########
 File path: sdks/python/apache_beam/utils/profiler.py
 ##########
 @@ -88,7 +88,11 @@ def __exit__(self, *args):
       self.profile_output = dump_location
 
     if self.log_results:
-      s = io.StringIO()
+      try:
+        import StringIO  # Python 2
 
 Review comment:
   NIT: Do we want to add a comment something like `# TODO(BEAM-8371): Python2 
should use StringIO` so it's easy to find it when we cleanup Py2 -> Py3? 

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to