PyCG icon indicating copy to clipboard operation
PyCG copied to clipboard

Bug Report: <TypeError: object of type 'Definition' has no len()>

Open AllenSun1024 opened this issue 3 years ago • 1 comments

Hello, there is a bug in your code, I'm looking forward that you can fix it as soon as possible. The detailed information is listed as below:

1. Bug Description:

<TypeError: object of type 'Definition' has no len()> occurred when I was using PyCG to resolve tensorflow library code.

Other important information in the bug report may include:

File "/home/allen/anaconda3/envs/python3.9/lib/python3.9/site-packages/pycg/processing/base.py", line 187, in do_assign if pos < len(decoded):

2. Root Cause:

I installed pycg-0.0.4 after running command "pip install pycg" as your README.md suggested. However, in pycg/processing/base.py, line 184~185, your code written in github is if not isinstance(decoded, Definition) and pos < len(decoded): while the code in my local host after installation is if pos < len(decoded): , which triggered the bug.

3. Possible Solution:

Release the latest version to python.

Thanks!

AllenSun1024 avatar Dec 28 '21 09:12 AllenSun1024

Hello @QingYiSun, I will take a look at that as soon as time allows. Thanks!

vitsalis avatar Jan 02 '22 07:01 vitsalis