allow running python setup.py
@@ -83,7 +83,7 @@ package_data = {
package_data['cupy'] += cupy_setup_build.prepare_wheel_libs(ctx)
-if sys.argv[1] == 'egg_info':
+if len(sys.argv) < 2 or sys.argv[1] == 'egg_info':
# Extensions are unnecessary for egg_info generation as all sources files
# can be enumerated via MANIFEST.in.
ext_modules = []
