浏览代码

utils/mkhtml: fix print warning/fatal message during compilation (#2139)

Tomas Zigo 3 年之前
父节点
当前提交
7f6f550d79
共有 1 个文件被更改,包括 9 次插入1 次删除
  1. 9 1
      tools/mkhtml.py

+ 9 - 1
tools/mkhtml.py

@@ -48,7 +48,15 @@ try:
     import grass.script as gs
 except ImportError:
     # During compilation GRASS GIS
-    gs = None
+    _ = str
+
+    class gs:
+        def warning(message):
+            pass
+
+        def fatal(message):
+            pass
+
 
 HEADERS = {
     "User-Agent": "Mozilla/5.0",