瀏覽代碼

[hbase] Fix module has no attribute from io.StringIO when there is no avro module loaded (#3006)

Internal Jira: CDPD-44973

Co-authored-by: Harsh Gupta <42064744+Harshg999@users.noreply.github.com>
Mahesh Balakrishnan 3 年之前
父節點
當前提交
ef515e5f50
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      apps/hbase/src/hbase/views.py

+ 4 - 1
apps/hbase/src/hbase/views.py

@@ -101,7 +101,10 @@ def api_dump(response):
         #detect if avro file
         #detect if avro file
         if(data[:3] == '\x4F\x62\x6A'):
         if(data[:3] == '\x4F\x62\x6A'):
           #write data to file in memory
           #write data to file in memory
-          output = io.StringIO()
+          try:
+            output = io.StringIO()
+          except:
+            output = string_io()
           output.write(data)
           output.write(data)
 
 
           #read and parse avro
           #read and parse avro