@@ -1728,7 +1728,6 @@ identify_unbound_names(PyThreadState *tstate, PyCodeObject *co,
17281728 assert (globalsns == NULL || PyDict_Check (globalsns ));
17291729 assert (builtinsns == NULL || PyDict_Check (builtinsns ));
17301730 assert (counts == NULL || counts -> total == 0 );
1731- return 0 ;
17321731 struct co_unbound_counts unbound = {0 };
17331732 Py_ssize_t len = Py_SIZE (co );
17341733 for (int i = 0 ; i < len ; i ++ ) {
@@ -1737,48 +1736,50 @@ identify_unbound_names(PyThreadState *tstate, PyCodeObject *co,
17371736 int oparg = GET_OPARG (co , i , inst .op .arg );
17381737 int index = LOAD_ATTR_NAME_INDEX (oparg );
17391738 PyObject * name = GETITEM (co -> co_names , index );
1740- if (PySet_Contains (attrnames , name )) {
1741- if (_PyErr_Occurred (tstate )) {
1742- return -1 ;
1743- }
1744- continue ;
1745- }
1746- unbound .total += 1 ;
1747- unbound .numattrs += 1 ;
1748- if (PySet_Add (attrnames , name ) < 0 ) {
1749- return -1 ;
1750- }
1739+ (void )name ;
1740+ // if (PySet_Contains(attrnames, name)) {
1741+ // if (_PyErr_Occurred(tstate)) {
1742+ // return -1;
1743+ // }
1744+ // continue;
1745+ // }
1746+ // unbound.total += 1;
1747+ // unbound.numattrs += 1;
1748+ // if (PySet_Add(attrnames, name) < 0) {
1749+ // return -1;
1750+ // }
17511751 }
17521752 else if (inst .op .code == LOAD_GLOBAL ) {
17531753 int oparg = GET_OPARG (co , i , inst .op .arg );
17541754 int index = LOAD_ATTR_NAME_INDEX (oparg );
17551755 PyObject * name = GETITEM (co -> co_names , index );
1756- if (PySet_Contains (globalnames , name )) {
1757- if (_PyErr_Occurred (tstate )) {
1758- return -1 ;
1759- }
1760- continue ;
1761- }
1762- unbound .total += 1 ;
1763- unbound .globals .total += 1 ;
1764- if (globalsns != NULL && PyDict_Contains (globalsns , name )) {
1765- if (_PyErr_Occurred (tstate )) {
1766- return -1 ;
1767- }
1768- unbound .globals .numglobal += 1 ;
1769- }
1770- else if (builtinsns != NULL && PyDict_Contains (builtinsns , name )) {
1771- if (_PyErr_Occurred (tstate )) {
1772- return -1 ;
1773- }
1774- unbound .globals .numbuiltin += 1 ;
1775- }
1776- else {
1777- unbound .globals .numunknown += 1 ;
1778- }
1779- if (PySet_Add (globalnames , name ) < 0 ) {
1780- return -1 ;
1781- }
1756+ (void )name ;
1757+ // if (PySet_Contains(globalnames, name)) {
1758+ // if (_PyErr_Occurred(tstate)) {
1759+ // return -1;
1760+ // }
1761+ // continue;
1762+ // }
1763+ // unbound.total += 1;
1764+ // unbound.globals.total += 1;
1765+ // if (globalsns != NULL && PyDict_Contains(globalsns, name)) {
1766+ // if (_PyErr_Occurred(tstate)) {
1767+ // return -1;
1768+ // }
1769+ // unbound.globals.numglobal += 1;
1770+ // }
1771+ // else if (builtinsns != NULL && PyDict_Contains(builtinsns, name)) {
1772+ // if (_PyErr_Occurred(tstate)) {
1773+ // return -1;
1774+ // }
1775+ // unbound.globals.numbuiltin += 1;
1776+ // }
1777+ // else {
1778+ // unbound.globals.numunknown += 1;
1779+ // }
1780+ // if (PySet_Add(globalnames, name) < 0) {
1781+ // return -1;
1782+ // }
17821783 }
17831784 }
17841785 if (counts != NULL ) {
0 commit comments