GeezerVison is showing github.com — Fix generation of incorrect python type hints for enums · Vector35/binaryninja-api@608c84e
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: python/generator.cpp +5-3Lines changed: 5 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -181,7 +181,7 @@ void OutputSwizzledType(FILE* out, Type* type) |
181 | 181 | string name = type->GetNamedTypeReference()->GetName().GetString(); |
182 | 182 | if (name.size() > 2 && name.substr(0, 2) == "BN") |
183 | 183 | name = name.substr(2); |
184 | | - fprintf(out, "%sEnum", name.c_str()); |
| 184 | + fprintf(out, "%s", name.c_str()); |
185 | 185 | } |
186 | 186 | else |
187 | 187 | { |
@@ -253,8 +253,10 @@ int main(int argc, char* argv[]) |
253 | 253 | FILE* enums = fopen(argv[3], "w"); |
254 | 254 |
|
255 | 255 | fprintf(out, "import ctypes, os\n\n"); |
256 | | - fprintf(out, "from typing import Optional, AnyStr"); |
257 | | - fprintf(enums, "import enum"); |
| 256 | + fprintf(out, "from typing import Optional, AnyStr\n"); |
| 257 | + fprintf(out, "from .enums import *"); |
| 258 | + |
| 259 | + fprintf(enums, "import enum\n"); |
258 | 260 |
|
259 | 261 | fprintf(out, "# Load core module\n"); |
260 | 262 | fprintf(out, "import platform\n"); |
|