GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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
Filter options
  • python
    • generator.cpp
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎python/generator.cpp‎

Copy file name to clipboardExpand all lines: python/generator.cpp
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ void OutputSwizzledType(FILE* out, Type* type)
181181
string name = type->GetNamedTypeReference()->GetName().GetString();
182182
if (name.size() > 2 && name.substr(0, 2) == "BN")
183183
name = name.substr(2);
184-
fprintf(out, "%sEnum", name.c_str());
184+
fprintf(out, "%s", name.c_str());
185185
}
186186
else
187187
{
@@ -253,8 +253,10 @@ int main(int argc, char* argv[])
253253
FILE* enums = fopen(argv[3], "w");
254254

255255
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");
258260

259261
fprintf(out, "# Load core module\n");
260262
fprintf(out, "import platform\n");

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.